
    3j                         S r SSKJr  SSKJr  SSKJr  SSK	r	\	R                  r
\" \R                  5      S
S j5       r\" \R                  5      S
S j5       r\" \R                  5        SS j5       rS	rg)z&glu[Un]Project[4] convenience wrappers    )GLU)GL)lazyNc                    Uc$  [         R                  " [         R                  5      nUc$  [         R                  " [         R                  5      nUc$  [         R                  " [         R
                  5      n[        R                  " S5      n[        R                  " S5      n[        R                  " S5      n	U " XUXEUXxU	5	      n
U
b  U
[        R                  :w  a  [        S5      eUR                  UR                  U	R                  4$ )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              O/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/GLU/projection.py
gluProjectr      s     }!7!79| 7 79|1S"DS"DS"D$4$F f(8(88244::tzz4::--    c                 n   Uc$  [         R                  " [         R                  5      nUc$  [         R                  " [         R                  5      nUc$  [         R                  " [         R
                  5      n[        R                  " S5      n[        R                  " S5      n[        R                  " S5      n	U " XUXEU[        R                  " U5      [        R                  " U5      [        R                  " U	5      5	      n
U
(       d  [        S5      eUR                  UR                  U	R                  4$ 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$4T6<<-fll4.@F
 244::tzz4::--r    c
                    Uc$  [         R                  " [         R                  5      nUc$  [         R                  " [         R                  5      nUc$  [         R                  " [         R
                  5      n[        R                  " S5      n
[        R                  " S5      n[        R                  " S5      n[        R                  " S5      nU " XUXVU[        R                  " U
5      [        R                  " U5      [        R                  " U5      [        R                  " U5      5
      nU(       d  [        S5      eU
R                  UR                  UR                  UR                  4$ 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$4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    