yade-users team mailing list archive
Mailing list archive
Re: New particle shape
Thanks, Janek. I am a little confused with the last paragraph. How do I make sure that, with time, OpenGL's orientation on the user interface is same as the quaternion which is used in calculation?
Another question, in the file, I see vertices and faces being pushed back. Also there is a triangulation function. Is this a general polygonization method for any equation? Or is it only for a sphere-type particle? I think I saw an opengl function in the web to draw spheres, sth like gluSphere.
Will upload the routine in repository if it's successful
> Date: Thu, 19 Nov 2009 20:28:48 +0100
> From: janek_listy@xxxxx
> To: yade-users@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Yade-users] New particle shape
> boon chiaweng said: (by the date of Thu, 19 Nov 2009 22:50:23 +0800)
> > I would like to have a new particle shape, namely an ellipsoid with an equation f(x,y,z) = (x^2/a^2) + (y^2/b^2) + (z^2/c^2) -1. I am at the moment confused with OpenGL. How can I do it?
> That's a squashed sphere right? So to draw it in OpenGL you need to
> modify just one line after you copy/paste code from GLDrawSphere:
> this opengl scaling is linearly scaling the drawn stuff (in this case
> a sphere) in x,y,z directions.
> In fact a sphere with radius=1 is drawn but is scaled beforehand in
> x,y,z directions by a factor of "radius" variable.
> Make sure when your ellipsoids rotate, they will update their
> orientation quaternion. And before drawing anything in OpenGL it is
> rotated by this rotation. So in fact those radius1,2,3 will be sizes
> of your ellipsoids in x,y,z directions in coordinate system local to
> ellipsoid (not the global coordinate system).
> Janek Kozicki |
> Mailing list: https://launchpad.net/~yade-users
> Post to : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
Windows 7: Find the right PC for you. Learn more.