Jump to content
  • Advertisement
Sign in to follow this  
IMK

Need lite 3D rotation sample/library please

This topic is 3969 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

So I have just joined up as I am stuck and can think of no better place than this to find some help in finding some good advice and support. So can someone please help me out a point me in the direction or even post me a sample of a 3d rotation matrix in c/cpp that works for my situation. Basically all I want to do is rotate a set of three x,y,z vectors around there respective axies. I have found lots of math on the web but my maths is so rusty that I am finding it difficult to translate it into code. I have also found lots of 3D graphics libraries but they are all too big for what I want and focus on the 3D graphics and have lots of nice stuff for viewing, lighting and shading etc etc. All wonderful but far must more than I require. All I need is some code that will rotate vectors around in there space with out any regard for viewing etc. Many thanks in advance IMK

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by IMK
So I have just joined up as I am stuck and can think of no better place than this to find some help in finding some good advice and support.
So can someone please help me out a point me in the direction or even post me a sample of a 3d rotation matrix in c/cpp that works for my situation.

Basically all I want to do is rotate a set of three x,y,z vectors around there respective axies. I have found lots of math on the web but my maths is so rusty that I am finding it difficult to translate it into code. I have also found lots of 3D graphics libraries but they are all too big for what I want and focus on the 3D graphics and have lots of nice stuff for viewing, lighting and shading etc etc. All wonderful but far must more than I require. All I need is some code that will rotate vectors around in there space with out any regard for viewing etc.
Many thanks in advance IMK
Pretty much any math library will be able to do what you're asking about. Depending on what platform you're developing for, you might be able to use the DirectX math library. There are also a lot of open-source math libraries floating about. You could look at the CML (linked in my signature), the Wild Magic math library (at geometrictools.com), or any of various other similar libraries.

I'm not sure what you mean by 'rotate x,y,z vectors around their respective axes', but any decent math library will include support for construction of various types of rotation matrices (which I'm guessing is what you need).

Share this post


Link to post
Share on other sites
Little warning, but note that the Wild Magic math library is LGPL. If you release anything, you will have to release source/object files or libs that allow people to relink your application against newer versions of Wild Magic.

Share this post


Link to post
Share on other sites
Hello, and many thanks for your reply.
I had a look at http://cmldev.net/?page_id=9 but it is much larger than I need and figure it would take me a month to extract what I need. I am really looking for something very lite, one moduel 50 lines or so.

Again many thanks IMK

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
Take a look here. It has a small math library that is well commented.


Many thanks looks most interesting, but can't get the project to build so going to have to fiddle with it.

Many thanks IMK

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!