Click to See Complete Forum and Search --> : Billboarding
danday1974
Sep 4th, 2002, 08:52 PM
Hi every1
Here is some DX8 bilbboarding code wrotten in VB. It doesnt work :(. Well it does but not 100% properly. Can any1 debug it please? Its difficult to explain what is gping on but if u look at the project u will get a better understandsing. PS I think the problem lies with the matrixBBFixedY function or with the call to that function. The second argument passed to that function I think should be the centre of the bllboard. Maybe I am passing the wrong value to the function?
Cheers for any help
Dan
Zaei
Sep 4th, 2002, 09:45 PM
Yep, It was that function. Change one line to this:
.m22 = 1
You can figure out which line =).
It also seems that you should pass in the BOTTOM center of the billboard for it to work correctly.
Z.
Zaei
Sep 4th, 2002, 09:47 PM
In fact, simply pass 0, 0, 0 in for the "center". This could be incorrect, It will take some testing to figure out =).
Z.
danday1974
Sep 5th, 2002, 11:20 AM
Z
Thanks for your help I had pretty much given up on billboarding :). With the Y axis fixed billboard the alteration u said made everything wok 100%. I think the second parameter passed is actually a translation vector (I think that is the right word for moving something).
Changing the code to .m22=1 does not work for a billboard where none of the axis are fixed however. Do u know this code please?
Cheers for sorting the Y-Axis fixed BB out for me :)
Dan
Zaei
Sep 5th, 2002, 12:32 PM
No, the not locked billboard function works fine. The change was ONLY to the Locked function, because that function was incorrect, which is why it didnt work right.
Z.
Zaei
Sep 5th, 2002, 12:33 PM
And you are right, it IS a translation vector. The way I use the function, I create a billboard centered on the origin, and then use that vector to do the translation.
Z.
danday1974
Sep 5th, 2002, 08:53 PM
Im with u. Ive tried doing that now and got a nice forest of trees by translating the 'same' tree many times. I am still having troubles with the other billboarding function though (the billboard that is not fixed on any axis). I have not altered .m22 as I did in the FixedYBB function but after some testing it appears to 'sink' if u change the 'GroundLevel' variable.
Any ideas on this 1 please?
Thanks
Dan
PS The normal BB function is in the code I posted. To use it all u have to do is uncomment the call to the function so u can see the problem.
Zaei
Sep 5th, 2002, 08:59 PM
Yeah, since your billboard is not centered on the origin, the rotations get a bit screwy. Try creating the billboard arend the origin, and then using the translation vector to move it.
Z.
danday1974
Sep 5th, 2002, 11:32 PM
Z
Cheers for the advice :)
I will try it out
Thanks
Dan
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.