• Advertisement

Archived

This topic is now archived and is closed to further replies.

how to lock only one axis to rotate with billboards?

This topic is 5097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi im doing billboarding by getting the transpose of the camera matrix. then setting it as the current matrix. But i don''t know how to make the billboard object only move on one axis, and not the others. Thanks,

Share this post


Link to post
Share on other sites
Advertisement
Why dont you just calculate the Rotation of the desired axis and then make a world matrix which is rotated by it. Perhaps theres a speed issue, but i wonder how big the issue is, since you only have to calculate once per frame. Plus extracting the data from a matrix is probably not much faster.
I usually have a variable for all rotations in my Camera class: rotx, roty, rotz.
So its easy to just take the one I need.
If your changing the view matrix by giving in a vector, it shouldnt be a big deal to just calculate the vectors rotation on the one axix(a bit of trigonometrie).
Perhaps someone has a faster solution.
-CProgrammer

Share this post


Link to post
Share on other sites
I answered your question on this topic a week ago, try looking for my answer. If you need a more detailed answer, then ask on that topic instead of just restarting a new topic.

Share this post


Link to post
Share on other sites
quote:
Original post by JoeyBlow2
I answered your question on this topic a week ago, try looking for my answer. If you need a more detailed answer, then ask on that topic instead of just restarting a new topic.


Yeah, sorry I had no idea on what the code was doing at the time, and i never got around to having a better look at it.

http://gamedev.net/community/forums/topic.asp?topic_id=210970

ill see how i go,


oh and cprogrammer, i guess thats what everyone does, i heard something about setting values from the matrix class to 0 or something but i never got that to wrok

[edited by - johnnyBravo on March 7, 2004 6:15:34 PM]

Share this post


Link to post
Share on other sites
maybe take the angle of whichever axis you want to keep, do all the matrix transpose code, and then set the billboard with the stored angle on whichever axis it is for.. unless that''s what CProgrammer meant.

Share this post


Link to post
Share on other sites
quote:
Original post by Lee_
maybe take the angle of whichever axis you want to keep, do all the matrix transpose code, and then set the billboard with the stored angle on whichever axis it is for.. unless that''s what CProgrammer meant.


Yup thats pretty much it.

Share this post


Link to post
Share on other sites
sounds goood, i just gotta look up the matrix class and see what values are what, or maybe joeyblows answer has it

Share this post


Link to post
Share on other sites

  • Advertisement