Sign in to follow this  
danromeo

hlsl spherical billboard y rotation? math question

Recommended Posts

danromeo    238

Hi.  

 

I'm implementing a spherical billboard system for overhead views.  When the camera is directly overhead I don't want the billboard to rotate on it's Y axis but instead want to assign an arbitrary y rotation to the billboard, for example trees with varying y axis rotations.  

 

I'm forcing the billboard to face upward with these statements:  

 

sideVector=float3(1,0,0) //right
upVector=float3(0,0,-1)   //forward
 
How do I rotate this an x amount on the Y axis?  
 
Thanks 
 

Share this post


Link to post
Share on other sites
danromeo    238
sideVector=cross(float3(0,1,0), -input.rotation);
upVector=input.rotation;
 
does the trick, up facing billboard with rotation
Edited by danromeo

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