[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] converting "object position" to "view position" in (py)opengl



Er, the last three arguments return the data in C.  In Python, the syntax is different:

C: gluProject(objx,objy,objz,model,proj,view,winx,winy,winz)
Python: winx,winy,winz = gluProject(objx,objy,objz,model,proj)

And yes, it returns a z-coord, which should take into account the near clipping plane.  As long as the plane is ~0, (x,y) should be fairly accurate.

Keep in mind that the (x,y) coordinates are *real* coordinates, (i.e., the y is not flipped).  (0,0) is the bottom left.  If you rasterize the font as you were, it shouldn't be a problem.

Ian