Skip to main content
gamedev.net
🔒 Locked

Camera representation.

Started by kill Nov 12, 2000 at 9:12 PM 1 replies 200+ views
Original Post
kill
kill
Hi. I'm working on a simple 3D engine, and I am stuck on the transformation part of it. I've been asking questions before on this forum, but they weren't really clear, so I'll try again. I am trying to create a class that will define an object's(whether it's a camera or a model) position and direction in space. I don't want this class to be API dependant. Basically, here's what I am thinking. The position will be defined by a point in space, that's simple. A rotation will be defined by 3 orthogonal vectors (up, forward and right). If I want to move the object's position forward, I'll move it along the "forward" vector. If I want to rotate it, I'll specify a number of degrees and rotate it around one of the three vectors (either around the up, forward or right vector). Is this a correct representation? If not, can you please point me in a different direction? If it is, can someone point me to a tutorial, or a relatively simple source code that implements something like this? Thanks in advance. Edited by - kill on 11/12/00 9:13:19 PM
Gazza
Gazza
Yes you exactly the right idea.

There is a tutorial on Rotating the camera (dx7) at

www.mr-gamemaker.com

hope that helps
kill
kill
Thanks. That tutorial was very useful. Are there any OpenGL tutorials, though? It''s obviously API independent, but I am using OpenGL, not D3D, and I don''t want to use D3DX library.

If I can''t find an OpenGL tutorial, I''ll sweat on figuring this out myself, but if I can find one, that''d be great.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.