Results 1 to 6 of 6

Thread: billboarding problem

  1. #1
    Member Contributor
    Join Date
    May 2001
    Location
    Hamburg, Germany
    Posts
    63

    billboarding problem

    Hi!
    In my Project I´m doing a "camera" not by glutLookAt() or similar, but just by two calls of glRotatef, one fpr the x, the other for the y axis.
    Well, how can I now achieve that all polygons(I want to draw a sun..and later Particles) face my pseudo-camera???
    I tried just by Rotating negative values on both axis, but doesn´t work.
    Please help!
    Blob

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2001
    Location
    Michigan
    Posts
    7

    Re: billboarding problem

    Blegh, I just got done working on that! I'll get the exact code to you as soon as I can get on my computer again!
    -------------------------
    Trent (ShiningKnight)
    http://www.voxelsoft.com/sk

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2005
    Posts
    137

    Re: billboarding problem

    Pretty simple...
    Just call glRotatef along x and y with inverse angles so that it is not affected by the rotation and is always facing you

    i.e.

    glRotatef(30,1,0,0);
    glRotatef(50,0,1,0);

    DrawScene();

    glRotatef(-50,0,1,0);
    glRotatef(-30,1,0,0);

    DrawBillboard();

    now billboard will always be facing you

    Fastian

  4. #4
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Turin
    Posts
    258

    Re: billboarding problem

    Sorry, but the rotation "cheat" it's not the cleanest way to do billboarding, expecially if your matrix stack is growing faster. Think about getting back from a matrix of a robot harm or something similar.

    I personally use 2 ways :

    1)Real billboarding, get the actual matrix and use it to calculate the position of the billboarded poly.

    2)set an ortho view and use 2D coords to draw shapes. (I use this way for lens flares)
    http://nate.scuzzy.net for more samples on billboarding.

    rIO.sK
    [rIO^sPINNING kIDS] - rio@nospam.spinningkids.org

    -/- This is a signature virus. Add it to your signature. Help it spreading! -/-

  5. #5
    Senior Member Regular Contributor
    Join Date
    Oct 2005
    Posts
    137

    Re: billboarding problem

    Yeah, your right... the best way is always the right way. Mine was just a dirty hack for this particular situation

    cheers

    Fastian

  6. #6
    Member Contributor
    Join Date
    May 2001
    Location
    Hamburg, Germany
    Posts
    63

    Re: billboarding problem

    Ah Thank you, works with the code from http://nate.scuzzy.net very well!! Thanx!
    But the cheat doesn´t work...

Similar Threads

  1. Billboarding
    By Mukund in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-03-2012, 06:53 AM
  2. Another billboarding problem
    By Holrin in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-25-2004, 01:40 PM
  3. billboarding
    By Alessandro_dup1 in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 06-15-2003, 08:21 AM
  4. Another billboarding problem
    By lynear in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 06-16-2002, 11:01 AM
  5. Billboarding???
    By imported_Dan in forum OpenGL: User Software
    Replies: 1
    Last Post: 03-07-2000, 10:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean