View more

View more

View more

### Image of the Day Submit

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

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.

1 reply to this topic

### #1danromeo  Members

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

### #2danromeo  Members

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.