Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Texture that always faces to the viewer?

  1. #1
    Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    261

    Texture that always faces to the viewer?

    I´m talking about these 2D textures, that spin with, if you move arround them, so that you allways see the front of it.
    Many games use it and I want to use it for a particle system ... but I dunno how this technique is called and how I can code this in OpenGL?

    Regards,
    Diapolo

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Texture that always faces to the viewer?

    That method is called billboarding. Search the forum for billboards and you should find what you are looking for.

    [This message has been edited by DFrey (edited 05-03-2001).]

  3. #3
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Texture that always faces to the viewer?

    Try this:


    float mat[16];
    glGetFloatv(GL_MODELVIEW_MATRIX, mat);


    Your "Up" vector (mat[0],mat[4],mat[8])
    Your "Right" vector (mat[1],mat[5],mat[9])

    Use those to compase a quad and you're done.

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

    Re: Texture that always faces to the viewer?

    Look also on NAte Miller's web site for some implementation sample.


    rIO.sK http://www.spinningkids.org/umine
    [rIO^sPINNING kIDS] - rio@nospam.spinningkids.org

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

Posting Permissions

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