Re: [PyOpenGL-Users] gluUnProject Projection Failed
Brought to you by:
mcfletch
From: Greg E. <gre...@ca...> - 2010-04-13 10:30:13
|
Eleftherios Garyfallidis wrote: > wx,wy,wz= glu.gluUnProject(float(x),viewport[3]-float(y),0., > modelviewmatrix, > projectionmatrix, > viewport) I don't think that 0 is a valid value for the z coordinate when you're unprojecting in a perspective projection. Also, to get a ray, you need to know *two* points in the scene. The way I do it is to call gluUnProject twice, once with z = the near plane, and once with z = the far plane. A line between the two resulting points gives you your pick ray. -- Greg |