Home › Forums › Programming › Change center of camera orbit
- This topic has 4 replies, 3 voices, and was last updated 4 years, 3 months ago by
web.
-
AuthorPosts
-
2021-05-04 at 1:37 pm #40718
web
CustomerI got a topic which give me headaches for quite some time. Many times we have 3d objects together with “infoboxes”.
So for example: I click an object, the camera zooms to that object and a “infobox” is opening. Now I would like to have the 3d object on the left hand side of the screen and the infobox on the right hand side.
When I now wanna rotate the object (orbit the camera) the object is flying in a circle around the screen edges. Because the target of the camera is in the center of the screen but not of the object.
Is there anyway to change this behaviour of the camera? So that when I orbit the camera center is at the object. But make sure the object stays at the left hand side of the screen?
2021-05-05 at 7:49 am #40729
Mikhail LuzyaninStaffIs there anyway to change this behaviour of the camera? So that when I orbit the camera center is at the object. But make sure the object stays at the left hand side of the screen?
For this you can use special camera puzzles like “Camera Look at”
Attachments:
Co-founder and lead graphics specialist at Soft8Soft.
2021-05-05 at 7:58 am #40731web
CustomerBut doesnt the camera look at, centers the target to an object, which means that it will also be centered in the screen?
2021-05-27 at 11:31 am #41523thomasup
Customeryou can use app.camera.setViewOffset(1,1,.5,0,1,1) to introduce a lens shift via javascript.
this function is inherited from threejs, see docs here:
https://threejs.org/docs/#api/en/cameras/PerspectiveCamera.setViewOffsetwe used this to offset our rotation center, which works quite well because it also centers the perspective on the rotation center.
2021-07-19 at 10:39 am #43000web
Customeryou can use app.camera.setViewOffset(1,1,.5,0,1,1) to introduce a lens shift via javascript.
this function is inherited from threejs, see docs here:
https://threejs.org/docs/#api/en/cameras/PerspectiveCamera.setViewOffsetwe used this to offset our rotation center, which works quite well because it also centers the perspective on the rotation center.
Hey thomas,
sorry havent seen your reply. Thank you for that solution. My “workaround” to that topic is using the “app.camera.filmOffset”. This works great for me. But will give your solution a try.
-
AuthorPosts
- You must be logged in to reply to this topic.

