Sign in to follow this  

Need lite 3D rotation sample/library please

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

This topic is 3663 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this