defining camera axis vector instead of camera target
조회 수: 8 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Jan
2016년 5월 2일
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:
참고 항목
카테고리
Help Center 및 File Exchange에서 Camera Views에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!