public void Update() { screenBuffer.Clear(); depthBuffer.Clear(); pipeline.Draw( depthBuffer, screenBuffer, teapot.GetStandardAppDataForTriangles(), teapot.triangles.Select(x => x.vertex).ToArray() ); }
private static void DrawRotatingObject(IPipeline pipeline, RenderEntity[] entitiesApply, ICamera camera, CharRenderBuffer <float> charBuffer) { float framerate = 25f; float time = 10f; int totalFrame = (int)(framerate * time); float angleStep = JMath.PI_TWO / totalFrame; int frameInterval = (int)(1000f / framerate); for (int i = 0; i < totalFrame; i++) { pipeline.Draw(entitiesApply, camera); CRenderer.Render(charBuffer); entitiesApply[0].Transform.Rotation.X += angleStep; entitiesApply[0].Transform.Rotation.Z += angleStep; Thread.Sleep(frameInterval); } }