defining camera axis vector instead of camera target

7 vues (au cours des 30 derniers jours)
Ehud
Ehud le 1 Mai 2016
Commenté : Ehud le 2 Mai 2016
Hi
I'm trying to make a simulation of something like a "go pro" camera. In the simulation I have a 3d axes in which I have several geometries (spheres, boxes etc) spread all over and I want to walk in this "geometry world". Till now I can control the cam position, the "up" vector and the direction of the camera. Here is the problem: When I walk forward or backwards nothing appears to get closer or far. When I turn left or right the world's orientation changes good, but when it comes to see things getting closer and more far nothing happens. The reason is that in order to look forward all the time I must define a "camera terget" which is a very specific point in space, and make sure that its in the direction of my "face normal" This makes me a lot of trouble since every time I change my direction I need to define another new camera target point, and doing this will cause discontinuities in my view. It would be much easier if instead a cemera taget point I could have define only the camera's direction (view axis).
Any suggestions?
Thanks

Réponses (1)

Jan
Jan le 2 Mai 2016
The view direction V is the vector from the camera position P to the camera target T:
V = T - P
If you want you can normalize it. Because both representations of the orientation are equivalent, I do not see, why using one would cause "discontinuities", while the other doesn't.
See:
  1 commentaire
Ehud
Ehud le 2 Mai 2016
Hi Jan
The problem is not to get the normal vector. I have it even without the target point. The problem is that I'm obliged to define a target point in order to direct the camera. I dont want to use this point, I want to use a direction vector and this is why: Lets say I have a sphere infront of me and I'm heading towards it. in order to see it getting closer I must define a specific point (target point) in the sphere's direction. But... If I pass this target point or worse, if I change my direction, I must define a new target point. Defining a new target point is what will cause the discontinuity of how I see the rest of the "world". If instead of defining a specific target point I could have tell the camera in which direction to look, I believe problem would be solved

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by