Results 1 to 9 of 9

Thread: Billboarding

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    118

    Billboarding

    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
    Attached Files Attached Files

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Yep, It was that function. Change one line to this:
    Code:
    .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.

  3. #3
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    In fact, simply pass 0, 0, 0 in for the "center". This could be incorrect, It will take some testing to figure out =).

    Z.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    118
    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

  5. #5
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  6. #6
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    118
    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.

  8. #8
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    118
    Z

    Cheers for the advice

    I will try it out

    Thanks

    Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width