how to lock only one axis to rotate with billboards?

Started by
5 comments, last by johnnyBravo 20 years, 1 month ago
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,
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
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.
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]
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.
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.
sounds goood, i just gotta look up the matrix class and see what values are what, or maybe joeyblows answer has it

This topic is closed to new replies.

Advertisement