Jump to content
  • Advertisement

Archived

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

ManDark

software 3d rotation

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!