开发者

convert camera position

开发者 https://www.devze.com 2023-01-16 03:20 出处:网络
I have a function from an external lib which takes the following camera parameters: x,y,z coordinates for \"center of

I have a function from an external lib which takes the following camera parameters:

  • x,y,z coordinates for "center of orbit"
  • x,y,z vector from "center of orbit" to "camera direction"
  • orbital radius
  • camera roll

How can I calculate these parameters from the ones I got:

?

And on a related subject: what's a 'camera roll' anyway? Is there somewhere a picture explaining this?


x,y,z coordinates for "center of orbit"

  • I guess this is up to you, let's call it "centerOrbit"

orbital radius

  • orbitalRadius = Length(cameraPos - centerOrbit)

x,y,z vector from "center of orbit" to "camera direction"

  • (cameraPos - centerOrbit) / orbitalRadius

camera roll

  • this could be your "decline angle of the camera" (just guessing again)
  • for explanation of what is a camera roll, try googling "yaw pitch roll"
0

精彩评论

暂无评论...
验证码 换一张
取 消