Transform world, or main object?
Hi,
My friend and I are starting on a simple flight simulator for enjoyment as well as learning. I've gone through some Direct X tutorials, and I have some basic movement implemented (still having some math errors, but thats beside the point).
My main question is: When moving around the world, should the main object - the plane in this case - be what moves while the world is stationary, or should the main object be stationary, and the world is moved around the object. The way its currently implemented is according to some Direct X tutorials, in which the world moves around the stationary object. I didn't know if there was a general rule of thumb, or a common practice in this case. It would seem to me that it would be easier to move the single object, but Direct X already has the Transform.World function which can greatly simplify things. Any input for either case would be appreciated. Thanks!
[Edited by - cghill on September 29, 2006 4:38:03 PM]
Niether. You don't actually get a choice; it's just a convention of interpretation on your part.
Transform.World is not a function. It's a matrix. And it does not transform the world; it transforms thing into the world's coordinate system (i.e., into the world).
When you submit a collection of vertices to be rendered (by any API), those vertices are assumed to be what is known as "model space," the coordinate space in which the model is conviently defined. For example, a cube is usually built in a model space where the origin (0,0,0) is the center of the cube. Humanoid characters may be built in a model space where the origin is at their feet.
A matrix transformation is applied to those model space points to bring them into world space, the coordinate system where (0,0,0) is the origin of the world and all objects are arranged relatively in it. In additional to specifying the location and orientation of all objects in the world (include both your plane and all the scenary objects that make up the actual visible landscape), you specify the location and orientation of the camera; the point from which you will ultimatley be viewing the rendered scene.
The location and orientation of the camera allows you to define a matrix transformation that brings the objects in world space into view space, a space where (0,0,0) is the location of the eye and the direction you are looking along is a specific axis (usually Z).
After this, a projection matrix transformation is applied to bring the geometry into what is known as clip space, and from there we move to normalized device coordinate space and finally window space, where rasterization ultimately occurs. These last two spaces are not really that relevant right now.
The first transformation is known as the "world transform," and that is what Transform.World is. It doesn't move the world, it positions and orients an object within the world.
The second transform is known as the "view transform."
The third transform is known as the "projection transform."
You can elect whether or not to interpret the viewing transformation as "rotating the world" or "rotating the view," but it is purely an interpretation. You don't really elect to "move the world around your plane" or "move the plane in the world" unless the plane also happens to be the point at which your camera is (in which case, why draw the plane?).
If you can, I would suggest picking up these books:
Fundamentals of Computer Graphics
The Geometry Toolbox
They do an excellent job of explaining what is going on here. Much better than any tutorial will.
Quote:
Direct X already has the Transform.World function
Transform.World is not a function. It's a matrix. And it does not transform the world; it transforms thing into the world's coordinate system (i.e., into the world).
When you submit a collection of vertices to be rendered (by any API), those vertices are assumed to be what is known as "model space," the coordinate space in which the model is conviently defined. For example, a cube is usually built in a model space where the origin (0,0,0) is the center of the cube. Humanoid characters may be built in a model space where the origin is at their feet.
A matrix transformation is applied to those model space points to bring them into world space, the coordinate system where (0,0,0) is the origin of the world and all objects are arranged relatively in it. In additional to specifying the location and orientation of all objects in the world (include both your plane and all the scenary objects that make up the actual visible landscape), you specify the location and orientation of the camera; the point from which you will ultimatley be viewing the rendered scene.
The location and orientation of the camera allows you to define a matrix transformation that brings the objects in world space into view space, a space where (0,0,0) is the location of the eye and the direction you are looking along is a specific axis (usually Z).
After this, a projection matrix transformation is applied to bring the geometry into what is known as clip space, and from there we move to normalized device coordinate space and finally window space, where rasterization ultimately occurs. These last two spaces are not really that relevant right now.
The first transformation is known as the "world transform," and that is what Transform.World is. It doesn't move the world, it positions and orients an object within the world.
The second transform is known as the "view transform."
The third transform is known as the "projection transform."
You can elect whether or not to interpret the viewing transformation as "rotating the world" or "rotating the view," but it is purely an interpretation. You don't really elect to "move the world around your plane" or "move the plane in the world" unless the plane also happens to be the point at which your camera is (in which case, why draw the plane?).
If you can, I would suggest picking up these books:
Fundamentals of Computer Graphics
The Geometry Toolbox
They do an excellent job of explaining what is going on here. Much better than any tutorial will.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement