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.

Change center of camera orbit

Home Forums Programming Change center of camera orbit

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40718
    web
    Customer

    I 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?

    #40729

    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?

    For this you can use special camera puzzles like “Camera Look at”

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

    Co-founder and lead graphics specialist at Soft8Soft.

    #40731
    web
    Customer

    But doesnt the camera look at, centers the target to an object, which means that it will also be centered in the screen?

    #41523
    thomasup
    Customer

    you 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.setViewOffset

    we used this to offset our rotation center, which works quite well because it also centers the perspective on the rotation center.

    #43000
    web
    Customer

    you 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.setViewOffset

    we 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. :good:

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