public void Draw(float rotate) { //iscrtavanje tenka Gl.glPushMatrix(); Gl.glTexEnvi(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_MODE, Gl.GL_ADD); Gl.glTranslatef(translateX, translateY, translateZ); Gl.glScalef(0.2f, 0.2f, 0.2f); Gl.glRotatef(rotateDegree + rotate, rotateX, rotateY, rotateZ); tankModel.Draw(); Gl.glTexEnvi(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_MODE, Gl.GL_DECAL); Gl.glPopMatrix(); }
public void Draw(float scale, bool inAnimation) { float[] lightPosShip = { translateX, translateY + 5.0f, translateZ, 1.0f }; //iscrtavanje svetla Gl.glLightf(Gl.GL_LIGHT1, Gl.GL_SPOT_CUTOFF, 180.0f); Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_POSITION, lightPosShip); Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_DIFFUSE, new float[] { 1, 1, 0, 1 }); Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_AMBIENT, ambLight); Gl.glEnable(Gl.GL_LIGHT1); //iscrtavanja broda Gl.glPushMatrix(); Gl.glTranslatef(translateX, translateY, translateZ); Gl.glScalef(0.1f + scale, 0.1f + scale, 0.1f + scale); Gl.glRotatef(rotateDegree, rotateX, rotateY, rotateZ); shipModel.Draw(); Gl.glPopMatrix(); projectil.Draw(inAnimation); }