We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Rotate orthographic camera

Home Forums Programming Rotate orthographic camera

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #80961
    David Duperron
    Customer

    Hi!
    I use an orthographic camera in my application, that I can position to get standard orthographic views (Left/right, front/back, top/bottom).
    BUT i would like to rotate my Top view 90° exactly, without mouse tweaking, and I cannot find how to do this… trying to rotate the camera itself has no effect.
    Is there a way to achieve this? by acting on the app.controls perhaps? on the camera target object??
    Any help would be appreciated!
    Regards

    David

    #80979

    Hi,
    You might use the tween camera puzzle with slight almost invisible offset to X or Y coordinate, e.g:

    In the first case camera will look -X (left) +X (right)
    In the second case camera will look -Y (left) +Y (right)

    Attachments:
    You must be logged in to view attached files.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #81024
    David Duperron
    Customer

    Hi!
    Thank you for your suggestion. I had already identified this tweak that makes the camera “rotate” 90degrees either way…
    BUT I also need to rotate my Camera with a given angle which is not 90° in another use case, and as far as I could see I cannot achieve this result with your tweak. That’s why I searched for a more generic and “clean” way to do it… Do you know where I could find a good explanation of how the camera position and orientation is controlled and how the app.controls influences all this??

    Cheers

    David

    #81034
    David Duperron
    Customer

    Implementing this with Verge3D would be great indeed… it seems to answer all the possible needs with style…

    #81036

    Hi,
    Unfortunately, it’s quite difficult to do with our current OrbitControls API. I’d suggest rotating the model instead of the camera in such case.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #81038
    kdv
    Participant

    I use an orthographic camera in my application

    I just wonder why are you using the Orbit controls with the ortho camera? Use the flying controls (or no controls at all) and rotate it at any angle…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #81039
    David Duperron
    Customer

    I can understand that this is not trivial! Unfortunately I’ve already try to play with the Scene object rotation and it’s messing up a lot of other things…
    Just so that I understand better your implementation of the OrbitControls: it seems that trying to rotate an orthographic camera (either direction) has NO effect, wether moving it in its local space or the global space DOES have an impact.
    The UP direction of the ortho camera is an automatic calculation based on the position of the camera and the position of its target, and it’s always pointing up the screen?

    #81040
    David Duperron
    Customer

    Hi KDV,
    I use the Orbit control because I want my user to be able to navigate my 3D scene the way he wants, using either a perspective camera, or an ortho camera… I’m trying to replicate a tradiationnal 3D software navigation.

    #81041
    kdv
    Participant

    You should manipulate the orbiting point position to rotate your camera. Trying to rotate the camera itself is useless because it will always look back at the orbiting point.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #81042
    David Duperron
    Customer

    Thank you KDV for this quick video. That’s what I understood while playing with all these camera stuff. However, assigning a new empty object to the controls.targetObj will mess up with the normal OrbitControls, that’s not what i want to do.
    I managed to get what I needed with a little bit of trigonometry, by moving the camera in X/Y direction, with very little distances (approx 1mm is OK) , depending on the angle I want to achieve. This does the job.

    #81045
    kdv
    Participant

    assigning a new empty object to the controls.targetObj will mess up with the normal OrbitControls

    Nope. You just replace one empty object with another one having a name which is visible in puzzles. As you can see on the video at the very begining, I can rotate the scene as usual after replacing the target object…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.