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