Proscene - default camera

edited December 2013 in Library Questions

Hey!

I tried to use scene.setCameraType(ORTHOGRAPHIC); to set the default camera as orthographic, but the program gives an error saying i'm using an argument (int)... Any thoughts?

Thanks!

Tagged:

Answers

  • You know how it is said that Processing is a simplified version of Java?

    It applies to this case. Instead of doing what you're doing right now, you could just use ortho() to set the camera type and position. Here's the reference page: http://processing.org/reference/ortho_.html

  • Oh never mind. Sorry, I didn't read the category. If this is irrelevant, ignore the first post.

  • Answer ✓

    It's a constant inside the static class Type inside the Camera class. So the correct syntax is: scene.setCameraType(Camera.Type.ORTHOGRAPHIC);

    Then you will probably get the error: Cannot find anything named "Camera". So you'll have to import it explicitly. For the latest proscene version with: import remixlab.dandelion.core.Camera;

    For the record, one can also interactively switch between camera types by pressing 'e'.

  • It's a constant inside the static class Type inside the Camera class.

    I love static, we can use them w/o instantiating their classes! \m/
    Also, static fields save RAM space b/c they aren't instantiated for each class object! ;))

  • After looking at the source code, I found out that it's actually an enum. Suggested syntax remains the same though. :)

Sign In or Register to comment.