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.

SOLVED – Automatic panning for orthographic camera

Home Forums Programming SOLVED – Automatic panning for orthographic camera

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

    Hi again!
    Another thing with orthographic camera.
    I would like to automatically pan an orthographic camera to a specific location in the 3D world (an object position for instance), WITHOUT changing its orientation, i.e. the same way as when I pan it manually with my mouse.
    The “tween camera” puzzles would do that if only I knew from which camera position I start with its associated target, to the desired destination camera position point with the new target (the desired object)…
    Does anyone know how to do that??
    Thanks!

    #80822

    Hi,
    If you move your camera along some plane, you might calculate position/look inputs by hand (by passing vectors to the corresponding inputs):

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #80831
    David Duperron
    Customer

    Hi Alexander!
    Thanks for your reply.
    I was already looking that way with the Verge3D API, to get the right final position vector…
    here is the procedure I wrote to get this vector, that I can use in the tween camera puzzle. Took me quite a while to get the differences between the Vector3 and the simple array that this puzzle takes as an input!

    Anyway it works now.

    I guess it could be a nice addition to the camera puzzles, “tween to target keeping camera offset and direction”

    #80833
    David Duperron
    Customer

    EDIT!
    the object3D.position is in the parent referential, which is not what we generally want!
    this is the correction, with the .getWorldPosition() method on the Object3D:

    #80841

    Cool solution :good:

    Soft8Soft Tech Chief
    X | FB | LinkedIn

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