
How to draw a 3D cube in openTK
Posted Friday, 26 October, 2012 - 17:21 by tokano inHello guys!
My head is burning because i cant figure out how to create a simple 3d CUBE inside the glcontrol...
My code is:
GL.Color3(Color.White); GL.Vertex3(100, 100, -100); GL.Vertex3(-100, 100, -100); GL.Vertex3(-100, 100, 100); GL.Vertex3(100, 100, 100); GL.Color3(Color.White); GL.Vertex3(100, -100, 100); GL.Vertex3(-100, -100, 100); GL.Vertex3(-100, -100, -100); GL.Vertex3(100, -100, -100); GL.Color3(Color.White); GL.Vertex3(100, 100, 100); GL.Vertex3(-100, 100, 100); GL.Vertex3(-100, -100, 100); GL.Vertex3(100, -100, 100); GL.Color3(Color.White); GL.Vertex3(100, -100, -100); GL.Vertex3(-100, -100, -100); GL.Vertex3(-100, 100, -100); GL.Vertex3(100, 100, -100); GL.Color3(Color.White); GL.Vertex3(-100, 100, 100); GL.Vertex3(-100, 100, -100); GL.Vertex3(-100, -100, -100); GL.Vertex3(-100, -100, 100); GL.Color3(Color.White); GL.Vertex3(100, 100, -100); GL.Vertex3(100, 100, 100); GL.Vertex3(100, -100, 100); GL.Vertex3(100, -100, -100);
And the result is this picture:
http://postimage.org/image/7e7jxr7k7/
What i'm looking for is like here: http://www.youtube.com/watch?v=BXxylZMuqnU
Can anyone help me? I've got a few templates from TaoFrameowkr library, but they are just not the same.


Comments
Re: How to draw a 3D cube in openTK
Did you use GL.Begin(Beginmode.quads) and GL.End() ? Also , put your whole renering sub because this won't help anybody ...
And I think a distance of 100 might be big ...