Jump to content

camera position and setTarget


Recommended Posts

Can someone please help with setting the position/target of a camera.  i create a new ArcRotateCamera and set its position.

var camera = new BABYLON.ArcRotateCamera("Camera", 0, Math.PI / 2, 50, BABYLON.Vector3.Zero(), scene);
camera.setPosition(new BABYLON.Vector3(20, 150, -15));

camera.attachControl(canvas, true);


I create a set of axis and it positions in the middle of my scene.  When I zoom in and out it appears to zoom axis position 0,0,0.  Which is fine to begin with.  I want to be able to give a position along one of the axis and change where i zoom to.  I tried using camera.setTarget

camera.setTarget = new BABYLON.Vector3(guiControls.x, guiControls.y, guiControls.z);

But no values i put in seem to affect the zoom point.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...