Jump to content

Confusion about camera positions


entropy
 Share

Recommended Posts

I'm confused about what, exactly, the position of a camera means. It seems like this would be straightforward, but I'm seeing strange results when I switch between camera types. Here's a playground that illustrates:

https://playground.babylonjs.com/#TJTYGR

In the above PG, line 5 creates the camera (in this case, an AnaglyphArcRotateCamera). I confirm that it is set to the proper position and target by logging those parameters in the console. So far, so good.

Now, switch to the regular ArcRotateCamera (comment out line 5, uncomment line 6). The same position, target, radius, etc., produces a different point of view--the camera is placed closer to the boxes. The console log confirms all of the camera parameters are the same.

Is there some reason for this behavior?

 

Link to comment
Share on other sites

Thanks for the replies so far. This leads me to another point of confusion: if we play the same game using the UniversalCamera (switching between the regular and anaglyph versions), there is no change in perspective. In the following PG, you can switch between them on lines 5 and 6:

https://playground.babylonjs.com/#TJTYGR#1

Overall, UniversalCamera, AnaglyphUniversalCamera, and ArcRotateCamera all render the scene from the same perspective (all other things being equal)--only AnaglyphArcRotateCamera is different. The main reason I created this topic is that I'm seeing rendering differences between AnaglyphUniversalCamera and AnaglyphArcRotateCamera, so I'm trying to decide if the difference stated above is a feature or a bug. I was trying to create a scene where I can switch between AnaglyphUniversalCamera and AnaglyphArcRotateCamera to study the rendering differences in greater detail, but noticed this change in perspective when placing them in the same position.

Link to comment
Share on other sites

10 minutes ago, Sebavan said:

Interesting indeed, I know @Deltakosh made some changes recently on the anaglyph so this might come from here ?

Let s check with him in a week once he ll be back from vacation.

Yes, I think those changes were made, in part, due to bug reports I filed here:

I wanted to make sure that this latest issue I was seeing was not due to a misunderstanding on my part before bothering Deltakosh!

Edit: I should also mention that I tried to look at the source code to find where any changes in perspective might arise. I can't seem to find any difference in the rigging between the different cameras (but I'm very much a novice in TS/JS, and its hard to find all the possible locations in the code where it might be set).

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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