NightmareX2000's picture

VBO with complex structures?

I'm not that exprienced in 3D graphics and OpenGL, hope you don't mind my mistakes...

I have a struct that has needings of a Vertex (texcoord, normal, position), but I have no idea how to use it with VBOs.

public struct Vertex
{
	public Vector2 TexCoord;
	public Vector3 Normal;
	public Vector3 Position;
}

As all those examples work with seperate elements but my project has so many things to do with XmlSerialization, that's why I'm trying to put these in a hierarchical order, otherwise things will get impossible to work around.

Thanks in advance...


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Are you using shaders or the legacy fixed function pipeline? You can use complex structures in all cases, but the exact OpenGL calls are slightly different.

Take a look at http://www.opentk.com/doc/graphics/geometry, sections 3a and 3b, as well as the example code in opentk/Source/Examples/OpenGL/1.x/VBOStatic.cs.