
draw multiple spheres of random sizes in opentk control
Posted Wednesday, 28 September, 2011 - 10:31 by safee inHi,
I would like to draw spheres in random positions using the opentk control.
I saw the example at http://www.opentk.com/node/1800
However, it only makes 1 sphere, which is hard to move or resize.
Any ideas?
Thanks


Comments
Re: draw multiple spheres of random sizes in opentk control
If you want to make the spheres move, generate a random number and call GL.Translate() before drawing it. If you are using the Matrix4 class to store transformations, just multiply it by Matrix4.CreateTranslation().
As for resizing, you could modify the sphere generation code to accept a radius variable, which would essentially just be multiply all the vertices by your radius.
Re: draw multiple spheres of random sizes in opentk control
Thanks! Its working nicely now!