I am creating simple 3D editor. I now can draw simple primitives like cube but, I don't know how to save this object to som variable and then copy it to other coordinates. I also don't know how rotate/scale/move this cube and save this new shape to variable. I have seen many tutorials on this topic, but in every one them, guy is moving only camera, not drawn object(cube). So basically I just need tutorial how to save some object to variable, than load this object from variable and draw it many times on different coordinates over scene and apply some transformation to these new objects(move,rotate,scale). I am creating this app in C# and OpenTK
Asked
Active
Viewed 1,658 times
1 Answers
0
Use the GL.Translate(x,y,z)
, GL.Rotate(θ,x,y,z)
and GL.Scale(sx,sy,sz)
functions to move the coordinate system origin, orientation and scaling.
So drawing a cube after the command
GL.Translate(10,10,100);
will draw the cube at the above location. Here is an (clunky) example of this process below:

John Alexiou
- 28,472
- 11
- 77
- 133
-
Thanks man, I just want to know, every object drawn after calling GL.Rotate, will be rotated too, am I right? – Frees Apr 16 '13 at 13:09
-
Ok, I just have one more question. I want to select drawn object with mouse and then rotate it for example, Could you please tell me how to do this? Documentation on OpenTK site is not very good for this topic. – Frees Apr 21 '13 at 19:09