Drawing particle groups in box2d -


Is anyone using ParticleGroup s for JBox2d I have been able to define a particle group area, but I am unsure how to draw individual particles using OpenGL ..

  m_world Is .setParticleRadius (0.15f); M_world.setParticleDamping (0.2f); Polygon shape shape = new polygon size (); Size .Setbox (8, 10, new VAC 2 (-12, 10.1F), 0); Particle Group Def Pd = New Particle Group Group (); Pd.shape = size; M_world.createParticleGroup (PD);  

In this way I have to draw a normal class in my project, but it is not certain how to implement groups of particles.

>
  Public Zero Draw (GlodraWrobal GLRLBable, VAC3 Status, Float Angle) {GLRLLAB.GGL (). IOGL 2 (). Glennable (GLGLBLANA); . GLDrawable.getGL () getGL2 () glEnable (GL.GL_TEXTURE_2D). GLDrawable.getGL () GetGL2 (). GlBlendFunc (GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); GLDrawable.getGL () GetGL2 (). GlBindTexture (GL2.GL_TEXTURE_2D, Texture Factor. GetTextureSelection ())); . GLDrawable.getGL () getGL2 () glPushMatrix () .; GLDrawable.getGL () GetGL2 (). GlTranslatef (status x * getP2M (), position. Y * getP2M (), position.z); GLDrawable.getGL () GetGL2 (). GlRotated (Math.toDegrees (angle), 0, 0, 1); . GLDrawable.getGL () getGL2 () glBegin (GL2.GL_QUADS). GLDrawable.getGL () GetGL2 (). GlTexCoord2f (0.0f, 0.0f); GLDrawable.getGL () GetGL2 (). GlVertex3f (-getWidth) / 2 * getP2M (), -gatehit () / 2 * getP2M (), 0.0f); GLDrawable.getGL () GetGL2 (). GlTexCoord2f (0.0f, 1.0f); GLDrawable.getGL () GetGL2 (). GlVertex3f (-getWidth) / 2 * getP2M (), getHeight () / 2 * getP2M (), 0.0f); GLDrawable.getGL () GetGL2 (). GlTexCoord2f (1.0f, 1.0f); GLDrawable.getGL () GetGL2 (). GlVertex3f (getWidth) / 2 * getP2M (), getHyight () / 2 * getP2M (), 0.0f); GLDrawable.getGL () GetGL2 (). GlTexCoord2f (1.0f, 0.0f); GLDrawable.getGL () GetGL2 (). GlVertex3f (getWidth) / 2 * getP2M (), -getHeight () / 2 * getP2M (), 0.0f); . GLDrawable.getGL () getGL2 () glEnd () .; . GLDrawable.getGL () getGL2 () glFlush () .; . GLDrawable.getGL () getGL2 () glPopMatrix () .; . GLDrawable.getGL () getGL2 () glDisable (GL.GL_TEXTURE_2D). . GLDrawable.getGL () getGL2 () glDisable (GL.GL_BLEND). }  

Try to bring the status buffer:

  Vec2 [] Status = m_world.getParticlePositionBuffer ();  

Additionally, you can find colors:

  particle color [color] = m_world.getParticleColorBuffer ();  

Then I would like to draw related colors in each situation using OpenLL. I believe that you can write a very simple shader who will do a great job for this. I help you on this but I am not very familiar with OpenGL, despite it I have tried a lot to know it.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -