Thanks doc, The push pop and vertex list definitely makes sense for drawing. I did read about it but it didn't come to mind. I found a good tutorial here http://tartley.com/files/stretching_pyglets_wings/presentation/. I am sure there are more.
I think my trouble is: how would i see the coordinate after the gl transformation? I'm looking to calc distances and angles. I can store the 4x4 gl model view matrix, but wouldn't I need to do my own math to get the transformed coodrinates? <after googling> I found http://www.opengl.org/resources/faq/technical/transformations.htm FAQ 9.120 How do I find the coordinates of a vertex transformed only by the ModelView matrix? It's often useful to obtain the eye coordinate space value of a vertex (i.e., the object space vertex transformed by the ModelView matrix). You can obtain this by retrieving the current ModelView matrix and performing simple vector / matrix multiplication. So am I stuck doing my own math? If so numpy or something smaller? Feb 6, 11:55 pm, __doc__ <[email protected]> wrote: > On Feb 7, 5:22 am, Jimmy Chan <[email protected]> wrote:> and does > > the math to move and rotate them. > > Let opengl do the math, much quicker, also much simpler, see > glPushMatrix/glPopMatrix > > > My only thought is to put the glBegin glEnd block in > > Drawing primitives by specifying each vertex individually with > glVertex3f between glBegin and glEnd, while beeing flexible, is > incredibly slow, especially out of python. > You want to use pyglet.graphics.vertex_list and pyglet.graphics.batch > to avoid that. > > > Is there a common way > > to store these bunch of points, that will move and rotate together. > > Yes, as vertex lists as part of a pyglet.graphics.batch > > > I could have a for loop iterate over all the coordinates and rotate/move > > each one at a time but it seems logical to use a 4 x nCoordintes > > matrix and do matrix multiplication. Downside is this will require a > > nd_array class (probably from numpy). I'm leaning toward just > > importing numpy. Is this overkill or is this common? > > Let opengl do the math per vertex for you, see glPushMatrix/ > glPopMatrix. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
