Sign in to follow this  
Annoyed

[DX10] Rotation matrix construction issues.

Recommended Posts

I rendering a sphere with the usual rotation, scaling and translation. It is not that I don't understand rotation but apparently not enough. I want to place a flat object, say a disk on any given vertex and want it to be aligned such that the vertex normal is perpendicular to it's surface. I have managed to position the disk regardless of the spheres position/scale and/or rotation. but I can't get the rotation of the disk right. So what I'm looking for is how to construct a rotation matrix for my disk. I have looked into billboarding and I understand that this is a similar situation but somehow I am still unable to apply it. Any hints are appreciated.

Share this post


Link to post
Share on other sites
Quote:
Original post by Annoyed
I rendering a sphere with the usual rotation, scaling and translation.
It is not that I don't understand rotation but apparently not enough.

I want to place a flat object, say a disk on any given vertex and want it to be aligned such that the vertex normal is perpendicular to it's surface.

I have managed to position the disk regardless of the spheres position/scale and/or rotation. but I can't get the rotation of the disk right.

So what I'm looking for is how to construct a rotation matrix for my disk.
I have looked into billboarding and I understand that this is a similar situation but somehow I am still unable to apply it.

Any hints are appreciated.
This gets discussed a lot here - try searching the forum archives for 'align to normal' or 'align to vector', and you should be able to find some good explanations and code examples.

If that doesn't clear things up, perhaps you could describe what you've tried so far and where you're getting hung up.

Share this post


Link to post
Share on other sites

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