Jump to content

[SOLVED] Changing Camera Leads to Odd Camera Movement


xeroxM
 Share

Recommended Posts

Hey Guys,

first of all, I want to thank you for your great work in this forum, you really saved me a lot of time wanting to flip tables :P

But now i found something, what is driving me nuts for already two weeks.

So I am trying to develop a viewer for 3D objects which has, broken down on the most important things, two cameras which you can change. Those cameras happen to be the ArcRotateCam and the UniversalCam.

What I want to happen is, that if the user clicks a button the camera changes (this already works fine), I also want both cameras to have a default position where they "start" (which they already have) and I want the camera to always be at the right position with the right angle (the default position/angle i set with initalizing them) when the user changes to the selected cam (this is where something odd is happening).

So let's take this case:

- User uses ArcRotate Cam, moves the camera and wants to change to Universal Cam.
- User clicks the button and changes to Universal Cam -> Universal Cam is set to default position and default angle as its supposed to be.
- User moves Universal Cam
- User wants to change to ArcRotate Cam again and clicks button -> result: camera is not in default mode but there is some odd camera movement going on and camera is somewhere else.
- If the user now moves the ArcRotate Cam again and changes to the Universal Cam, the camera moves away from the target, instead of being directly on it.

I hope I described my problem properly and I really hope you got some answers. I broke the problem down in a Playground for you:
http://playground.babylonjs.com/#P5PWBB

There may be something missing cause I really broke the camera module down on the most important things. So if something is not clear, let me know!

All the best!
xeroxM

 

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