Jump to content

  • Log In with Google      Sign In   
  • Create Account

hlsl spherical billboard y rotation? math question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 danromeo   Members   -  Reputation: 237

Like
0Likes
Like

Posted 16 February 2014 - 06:36 PM

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 
 


Sponsor:

#2 danromeo   Members   -  Reputation: 237

Like
0Likes
Like

Posted 17 February 2014 - 12:50 AM

sideVector=cross(float3(0,1,0), -input.rotation);
upVector=input.rotation;
 
does the trick, up facing billboard with rotation

Edited by danromeo, 17 February 2014 - 12:54 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS