Sign in to follow this  

Basic question

Recommended Posts

This is a pretty basic question, but I can't seem to get it. I'm trying to get a world transform from a position and normal. I was using the following function, but it doesn't work when the normal is facing straight up or straight down: D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f); D3DXMatrixLookAtLH(&World, &Position, &(Position - Normal), &Up); D3DXMatrixInverse(&World, NULL, &World); I could check if the normal is straight up or straight down and offset it, but is there another way to do this?

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