本文整理汇总了C#中NewTOAPIA.GL.GraphicsInterface.Normal方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsInterface.Normal方法的具体用法?C# GraphicsInterface.Normal怎么用?C# GraphicsInterface.Normal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewTOAPIA.GL.GraphicsInterface
的用法示例。
在下文中一共展示了GraphicsInterface.Normal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderContent
protected override void RenderContent(GraphicsInterface gi)
{
int p1, p2, p3;
for (int i = 0; i < triangles.Length; i++)
{
p1 = triangles[i].p1;
p2 = triangles[i].p2;
p3 = triangles[i].p3;
gi.Color(1, 1, 1, 0.95f);
gi.Drawing.Triangles.Begin();
gi.Normal(normals[p1]);
gi.TexCoord(uvMap[p1, 0], uvMap[p1, 1]);
gi.Vertex(positions[p1]);
gi.Normal(normals[p2]);
gi.TexCoord(uvMap[p2, 0], uvMap[p2, 1]);
gi.Vertex(positions[p2]);
gi.Normal(normals[p3]);
gi.TexCoord(uvMap[p3, 0], uvMap[p3, 1]);
gi.Vertex(positions[p3]);
gi.Drawing.Triangles.End();
}
}
示例2: RenderContent
protected override void RenderContent(GraphicsInterface gi)
{
gi.Normal(0, 0, 1);
gi.Begin(BeginMode.Lines);
gi.Vertex(fxbase, fybase - 5, fzbase);
gi.Vertex(fxbase, fybase + fHeight * fSize + 0.5f, fzbase);
gi.End();
}
示例3: RenderContent
protected override void RenderContent(GraphicsInterface gi)
{
int i, j;
float theta, phi, theta1;
float cosTheta, sinTheta;
float cosTheta1, sinTheta1;
float ringDelta, sideDelta;
ringDelta = (float)(2.0f * Math.PI / fRings);
sideDelta = (float)(2.0f * Math.PI / fSides);
theta = 0.0f;
cosTheta = 1.0f;
sinTheta = 0.0f;
for (i = fRings - 1; i >= 0; i--)
{
theta1 = theta + ringDelta;
cosTheta1 = (float)Math.Cos(theta1);
sinTheta1 = (float)Math.Sin(theta1);
gi.Drawing.QuadStrip.Begin();
phi = 0.0f;
for (j = fSides; j >= 0; j--)
{
float cosPhi, sinPhi, dist;
phi += sideDelta;
cosPhi = (float)Math.Cos(phi);
sinPhi = (float)Math.Sin(phi);
dist = fOuterRadius + fInnerRadius * cosPhi;
gi.Normal(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
gi.Vertex(cosTheta1 * dist, -sinTheta1 * dist, fInnerRadius * sinPhi);
gi.Normal(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
gi.Vertex(cosTheta * dist, -sinTheta * dist, fInnerRadius * sinPhi);
}
gi.Drawing.QuadStrip.End();
theta = theta1;
cosTheta = cosTheta1;
sinTheta = sinTheta1;
}
}
示例4: RenderContent
protected override void RenderContent(GraphicsInterface gi)
{
int i;
for (i = 5; i >= 0; i--)
{
if (fStyle == CubeStyle.Solid)
gi.Drawing.Quads.Begin();
else
gi.Drawing.LineLoop.Begin();
gi.Normal(n[i]);
//gl.glNormal3fv(n[i]);
gi.Vertex3(v[faces[i][0]]);
gi.Vertex3(v[faces[i][1]]);
gi.Vertex3(v[faces[i][2]]);
gi.Vertex3(v[faces[i][3]]);
if (fStyle == CubeStyle.Solid)
gi.Drawing.Quads.End();
else
gi.Drawing.LineLoop.End();
}
}
示例5: RenderInsideRadiusCylinder
void RenderInsideRadiusCylinder(GraphicsInterface gi)
{
float angle;
// draw inside radius cylinder
for (int i = 0; i <= fTeeth; i++)
{
angle = i * 2.0f * (float)Math.PI / fTeeth;
gi.Drawing.Lines.Begin();
gi.Normal(-(float)Math.Cos(angle), -(float)Math.Sin(angle), 0.0f);
gi.Vertex(r0 * (float)Math.Cos(angle), r0 * (float)Math.Sin(angle), -fWidth * 0.5f);
gi.Vertex(r0 * (float)Math.Cos(angle), r0 * (float)Math.Sin(angle), fWidth * 0.5f);
gi.Vertex(r0 * (float)Math.Cos(angle), r0 * (float)Math.Sin(angle), -fWidth * 0.5f);
gi.Vertex(r0 * (float)Math.Cos(angle + 4 * da), r0 * (float)Math.Sin(angle + 4 * da), -fWidth * 0.5f);
gi.Vertex(r0 * (float)Math.Cos(angle), r0 * (float)Math.Sin(angle), fWidth * 0.5f);
gi.Vertex(r0 * (float)Math.Cos(angle + 4 * da), r0 * (float)Math.Sin(angle + 4 * da), fWidth * 0.5f);
gi.Drawing.Lines.End();
}
}