#### Archived

This topic is now archived and is closed to further replies.

# software 3d rotation

This topic is 6269 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I need to rotate some points in 3d-space, that could be a cube, a cylinder, a sphere, a car or whatever... I want the rotation to be done useing 3 degree values, x, y and z...what is the proper aproch and how to do it... any info would be nice...

##### Share on other sites
Look into matricies...specificly those of the 3 x 3 nature.

http://www.gamedev.net/reference/articles/article877.asp

"If consquences dictate our course of action, it doesn''t matter what''s right, it''s only wrong if you get caught."
- Tool

##### Share on other sites
Actually, if you're planning on implementing any other sorts of 3D transformations (eg translation) it'd be best to use 4x4 matrices. To convert a 3x3 rotation matrix to a 4x4 rotation matrix just add another row and another column and set 44 to 1.

(EDIT - spelled column wrong )

Edited by - Seanhowe on September 19, 2001 10:42:39 PM

##### Share on other sites
You might also try this article Mathematics for 3D Graphics. Overall look through the Articles & Resources Math and Physics section. There is a lot of good information there. If you have a strong interest in computer graphics and the math behind it then I suggest getting Computer Graphics: Principles and Practice by Foley and company and working through it. You can come up to speed much faster if you don''t particularly care about the mathematics and instead care more about just getting the job done by going with a book on programming a specific API. Under Resources/Books & Software there are lists of many types of books. Many have reviews and ratings to guide your selection.

I would tend to argue that anyone that isn''t particularly interested in math isn''t particularly cut out for graphics programming. There are many other aspects of game programming so I would suggest looking at what actually interests you. Game development is pretty much a team activity anymore so a person might as well do what they are most interested in and enjoy the most. I''m not saying graphics programming isn''t for you, but rather that if that is where your interests lie you are going to have to buy a few books at a minimum. If money is tight then there is a wealth of articles here and really all across the internet that will get you started. Ultimately it comes down to digging in and doing it, but you don''t want to be reinventing the wheel for the basic stuff. It is best to spend that effort struggling through what isn''t easily found or perhaps not even available.

##### Share on other sites
OK then (i''m not the original poster, btw,b ut i''m interested in the topic).

How do you view a 3d object as though from a certain point loking in a certain direction?

##### Share on other sites
That''s pretty simple. All you do is transform the world by the inverse data of the "camera", as the viewpoint is called:

struct {
float x, y, z, rx, ry, rz;
} camera;

..usual transform...
rotate(-camera.rx, -camera.ry, -camera.rz);
translate(-camera.x, -camera.y, -camera.z);

Think of it, very simple!

1. 1
Rutin
68
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 21
• 10
• 33
• ### Forum Statistics

• Total Topics
633438
• Total Posts
3011880
• ### Who's Online (See full list)

There are no registered users currently online

×