Beispiel #1
0
 internal void render(vec3 p, quat rot)
 {
     using (PushedMatrix dnum = new PushedMatrix())
     {
         mat.apply();
         Gl.glTranslatef(p.x, p.y, p.z);
         AxisAngle aa = rot.AxisAngle;
         // apply rotation
         Gl.glRotatef(aa.angle.inDegrees, aa.axis.x, aa.axis.y, aa.axis.z);
         Gl.glBegin(Gl.GL_TRIANGLES);
         foreach (MeshDef.Vertex[] face in faces)
         {
             for (int i = 0; i < 3; ++i)
             {
                 MeshDef.Vertex v    = face[i];
                 vec3           vert = (poseable.CurrentPose != null)
                     ? poseable.CurrentPose.transforms[v.bone] * v.vertex
                     : v.vertex;
                 Gl.glNormal3f(v.normal.x, v.normal.y, v.normal.z);
                 Gl.glTexCoord2f(v.uv.x, v.uv.y);
                 Gl.glVertex3f(vert.x, vert.y, vert.z);
             }
         }
         Gl.glEnd();
     }
 }
Beispiel #2
0
 public void render(int width, int height, Camera c)
 {
     Setup.view3d(width, height);
     using (PushedMatrix fm = new PushedMatrix())
     {
         c.sendRotation();
         RenderList list = new RenderList();
         cameraSendTo(list);
         list.render();
     }
     Gl.glClear(Gl.GL_DEPTH_BUFFER_BIT);
     using (PushedMatrix fm = new PushedMatrix())
     {
         c.sendRotationAndPosition();
         RenderList list = new RenderList();
         worldSendTo(list);
         list.render();
     }
 }