Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Basic question

Started by smittix 0 replies 450+ views
Original Post
smittix
smittix
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.