开发者

Moving the camera in a 3D space when camera is rotated (using Wikipedia Definition of 3D Projection)

I wonder if someone could tell me how to make it possible to move a camera in a 3D space when the camera is rotated.

I am working on my own 3D engine (nothing fancy) and I can move the camera forward backward left right up down, thats all good. However when I rotate the camera, it doesnt move in the direction that the camera is directed to.

Here is a picture that should help you understand what I mean:

http://www.xaid.se/camrot.jpg

Does anybody know how to make this work?

(If you're interested in what I'm working 开发者_如何学JAVAon, visit this site)


i'm not sure if i really get what you mean, but your problem looks like you want to move along the direction of the camera instead along one (main-)axis? therefore my solution would be to store a vector which keeps the direction the camera is looking, and update this vector everytime you rotate the camera. now you can use your direction vector for the forward movement. position + vector*stepsize. hope that helps a little bit.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜