Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

hlsl spherical billboard y rotation? math question

4: Adsense

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   

238
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 
 


#2 danromeo   Members   

238
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.