|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.OpenGl;
namespace AGE_Engine3D.RenderObjects
{
class TriangleGroup : IRenderOpenGL
{
#region Fields
public List<Vertex> Vetices = new List<Vertex>();
public bool IsFan = false;
#endregion
#region Methods
public void RenderOpenGL()
{
if (this.IsFan)
Gl.glBegin(Gl.GL_TRIANGLE_FAN);
else
Gl.glBegin(Gl.GL_TRIANGLE_STRIP);
foreach (Vertex tmpV in this.Vetices)
{
if(tmpV.IsColor)
Gl.glColor4fv(tmpV.Color.ToArray4f());
if(tmpV.IsTextured)
Gl.glTexCoord2fv(tmpV.TextureCoor.ToArray2f());
if(tmpV.IsNormal)
Gl.glNormal3fv(tmpV.Normal.ToArray3f());
Gl.glVertex3fv(tmpV.Position.ToArray3f());
}
Gl.glEnd();
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a licensed Electrical Engineer at Lea+Elliott, Inc. We specialize in the planning, procurement and implementation of transportation systems, with special emphasis on automated and emerging technologies.