Erakis
12-16-2001, 02:32 AM
Hello.
I've implemented a 3D particles fountain.
I have some problem to find out how set the particles face to the camera. My particles are build with QUADS. I've read some tutorials on this subject but they always refers to a trick about right/up vector inside the ModelView matrix ?
First, I will give you the position of my camera and so why I need to get a spherical BillBoard effect.
Coord of my camera :
CamPos.vX = 0.0;
CamPos.vY = 80.0;
CamPos.vZ = 180.0;
CamLook.vX = 0.0;
CamLook.vY = 20.0;
CamLook.vZ = 0.0;
Set my camera in the 3D world :
gluLookAt( CamPos.vX, CamPos.vY, CamPos.vZ,
CamLook.vX, CamLook.vY,CamLook.vZ,
0.0, 1.0, 0.0 );
Move the camera around the fountain :
CamPos.vX := sin(DegresRot) * 160.0;
CamPos.vZ := cos(DegresRot) * 160.0;
Call the fountain function :
glPushMatrix();
glDepthMask( GL_FALSE );
glEnable(GL_BLEND);
AnimParticles;
glDisable(GL_BLEND);
glDepthMask( GL_TRUE );
glPopMatrix();
In the AnimParticles, I just compute the news coord of the particles and I draw the QUADS that reprensent it. (I don't use any Translation or Rotations, I draw the particles right there, so At the current position).
There is my two problems :
First, is that I don't want the camera rotation affect the fountain/particles, I just want to rotate around it...
Secondly, the billboarding effects http://www.opengl.org/discussion_boards/ubb/wink.gif
A BIG Thanks.
Martin
I've implemented a 3D particles fountain.
I have some problem to find out how set the particles face to the camera. My particles are build with QUADS. I've read some tutorials on this subject but they always refers to a trick about right/up vector inside the ModelView matrix ?
First, I will give you the position of my camera and so why I need to get a spherical BillBoard effect.
Coord of my camera :
CamPos.vX = 0.0;
CamPos.vY = 80.0;
CamPos.vZ = 180.0;
CamLook.vX = 0.0;
CamLook.vY = 20.0;
CamLook.vZ = 0.0;
Set my camera in the 3D world :
gluLookAt( CamPos.vX, CamPos.vY, CamPos.vZ,
CamLook.vX, CamLook.vY,CamLook.vZ,
0.0, 1.0, 0.0 );
Move the camera around the fountain :
CamPos.vX := sin(DegresRot) * 160.0;
CamPos.vZ := cos(DegresRot) * 160.0;
Call the fountain function :
glPushMatrix();
glDepthMask( GL_FALSE );
glEnable(GL_BLEND);
AnimParticles;
glDisable(GL_BLEND);
glDepthMask( GL_TRUE );
glPopMatrix();
In the AnimParticles, I just compute the news coord of the particles and I draw the QUADS that reprensent it. (I don't use any Translation or Rotations, I draw the particles right there, so At the current position).
There is my two problems :
First, is that I don't want the camera rotation affect the fountain/particles, I just want to rotate around it...
Secondly, the billboarding effects http://www.opengl.org/discussion_boards/ubb/wink.gif
A BIG Thanks.
Martin