本文整理汇总了C#中IRenderer.PopMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderer.PopMatrix方法的具体用法?C# IRenderer.PopMatrix怎么用?C# IRenderer.PopMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderer
的用法示例。
在下文中一共展示了IRenderer.PopMatrix方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render(IRenderer renderer)
{
Vector3 pos3d = new Vector3(Position.X, -20, Position.Y);
renderer.PushMatrix();
renderer.Translate(pos3d);
renderer.Rotate(-Vector3.UnitY, Angle);
renderer.Rotate(Vector3.UnitZ, -Math.PI / 2);
renderer.PushMatrix();
if (harmless.Stopped)
renderer.DrawMesh(Mesh.RedPlane);
else
renderer.DrawMesh(Mesh.Shot);
renderer.PopMatrix();
renderer.PopMatrix();
}
示例2: Draw
public void Draw(IRenderer r, Node n)
{
r.PushMatrix();
for (int i = 0; i < Count; ++i)
{
Part.Draw(r, n);
r.MultMatrix(Offset);
}
r.PopMatrix();
}
示例3: RenderInternal
private void RenderInternal(IRenderer renderer)
{
Plane plane = this;
Mesh mesh = Mesh;
bool shadow = ShadowMode;
Vector3 pos3d = new Vector3((float)plane.X, -20, (float)plane.Y);
renderer.PushMatrix();
if (shadow)
{
renderer.PushMatrix();
renderer.Translate(new Vector3(0, 0, -20f));
GL.Scale(1, 1, 0);
GL.Disable(OpenTK.OpenGL.Enums.EnableCap.DepthTest);
}
renderer.Translate(pos3d);
renderer.Rotate(-Vector3.UnitY, plane.Angle);
renderer.Rotate(Vector3.UnitZ, -Math.PI / 2);
renderer.Color(Color.Green);
float mult = 1.0f;
float amin = mult * -3.6f, amax = mult * 1.5f;
float bmin = mult * -0.25f, bmax = mult * 0.45f;
if (!shadow)
renderer.DrawMesh(mesh);
else
{
renderer.Color(Color.Black);
renderer.DrawMeshIgnoreColors(mesh);
}
if (shadow)
{
GL.Enable(OpenTK.OpenGL.Enums.EnableCap.DepthTest);
renderer.PopMatrix();
}
renderer.PopMatrix();
}
示例4: Render
public void Render(IRenderer renderer)
{
renderer.PushMatrix();
renderer.Translate(new Vector3(0, -200, -50));
renderer.DrawMesh(Mesh.Backdrop);
renderer.PopMatrix();
}
示例5: RenderBox
void RenderBox(IRenderer renderer, Box2d box)
{
renderer.PushMatrix();
renderer.Translate(Logic2World(box.X, box.Y));
renderer.Rotate(-Vector3.UnitY, box.Rotation);
float amin = (float)box.Amin;
float amax = (float)box.Amax;
float bmin = (float)box.Bmin;
float bmax = (float)box.Bmax;
renderer.DrawLine(new Vector3(amin, 0, bmin), new Vector3(amin, 0, bmax));
renderer.DrawLine(new Vector3(amax, 0, bmin), new Vector3(amax, 0, bmax));
renderer.DrawLine(new Vector3(amin, 0, bmin), new Vector3(amax, 0, bmin));
renderer.DrawLine(new Vector3(amin, 0, bmax), new Vector3(amax, 0, bmax));
renderer.PopMatrix();
}