
    _e                         d Z ddlmZ ddlmZ ddlmZ ddl	Z	e	j                  Z
 eej                        d
d       Z eej                        d
d       Z eej                        	 	 dd       Zd	Zy)z&glu[Un]Project[4] convenience wrappers    )GLU)GL)lazyNc                    |#t        j                  t         j                        }|#t        j                  t         j                        }|#t        j                  t         j
                        }t        j                  d      }t        j                  d      }t        j                  d      }	 | |||||||||		      }
|
|
t        j                  k7  rt        d      |j                  |j                  |	j                  fS )zConvenience wrapper for gluProject
    
    Automatically fills in the model, projection and viewing matrices
    if not provided.
    
    returns (winX,winY,winZ) doubles
            Projection failed!)r   glGetDoublevGL_MODELVIEW_MATRIXGL_PROJECTION_MATRIXglGetIntegervGL_VIEWPORT_simpleGLdoubleGLU_TRUE
ValueErrorvalue)baseFunctionobjXobjYobjZmodelprojviewwinXwinYwinZresults              7/usr/lib/python3/dist-packages/OpenGL/GLU/projection.py
gluProjectr      s     }!7!79| 7 79|1S"DS"DS"DT$d4T$F f(8(88244::tzz4::--    c                 P   |#t        j                  t         j                        }|#t        j                  t         j                        }|#t        j                  t         j
                        }t        j                  d      }t        j                  d      }t        j                  d      }	 | ||||||t        j                  |      t        j                  |      t        j                  |	      	      }
|
st        d      |j                  |j                  |	j                  fS zConvenience wrapper for gluUnProject
    
    Automatically fills in the model, projection and viewing matrices
    if not provided.
    
    returns (objX,objY,objZ) doubles
    r   r   r   r	   r
   r   r   r   r   r   ctypesbyrefr   r   )r   r   r   r   r   r   r   r   r   r   r   s              r   gluUnProjectr&   %   s     }!7!79| 7 79|1S"DS"DS"DT$d4T6<<-fll4.@F
 244::tzz4::--r    c
                    |#t        j                  t         j                        }|#t        j                  t         j                        }|#t        j                  t         j
                        }t        j                  d      }
t        j                  d      }t        j                  d      }t        j                  d      } | ||||||t        j                  |
      t        j                  |      t        j                  |      t        j                  |      
      }|st        d      |
j                  |j                  |j                  |j                  fS r"   r#   )r   r   r   r   clipWr   r   r   nearfarr   r   r   objWr   s                  r   gluUnProject4r,   ?   s    }!7!79| 7 79|1S"DS"DS"DS"DT$d4T6<<-fll4.@dASF
 244::tzz4::tzz99r    )r   r&   r,   )NNN)NNNr   g      ?)__doc__
OpenGL.rawr   r   OpenGLr   OpenGL.lazywrapperr   _lazyr$   POINTERr   r&   r,   __all__ r    r   <module>r5      s    , %  , 
... .8 . .2  !%	:  :@r    