Changeset 1357
- Timestamp:
- 09/08/08 19:45:36 (2 months ago)
- Files:
-
- 1 modified
-
trunk/pysoy/src/models/Liquid.pym (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pysoy/src/models/Liquid.pym
r1356 r1357 85 85 cdef ode.dReal* _pos 86 86 cdef float _halfSize[3] 87 cdef gl.GLfloat _mtx[16] 88 # 89 ###################################### 90 # 91 # set model's matrix 92 # 93 _mtx[0] = _body._rotation[0] 94 _mtx[1] = _body._rotation[4] 95 _mtx[2] = _body._rotation[8] 96 _mtx[3] = 0.0 97 _mtx[4] = _body._rotation[1] 98 _mtx[5] = _body._rotation[5] 99 _mtx[6] = _body._rotation[9] 100 _mtx[7] = 0.0 101 _mtx[8] = _body._rotation[2] 102 _mtx[9] = _body._rotation[6] 103 _mtx[10] = _body._rotation[10] 104 _mtx[11] = 0.0 105 _mtx[12] = _body._position[0] 106 _mtx[13] = _body._position[1] 107 _mtx[14] = _body._position[2] 108 _mtx[15] = 1.0 109 # 110 ###################################### 111 # 112 # save current matix before setting it 113 # 114 gl.glPushMatrix() 115 gl.glMultMatrixf(_mtx) 116 # 117 ###################################### 118 # 119 # render liquid surface and bottom 120 # 87 121 _pos = _body._position 88 122 _halfSize[0] = self._size[0]/2.0 … … 101 135 gl.glEnable(gl.GL_DEPTH_TEST) 102 136 # 103 #RENDER BODIES 137 ###################################### 138 # 139 # return to camera matrix 140 # 141 gl.glPopMatrix() 142 # 143 ###################################### 144 # 145 # render each body inside the liquid 146 # 104 147 gl.glEnable(gl.GL_FOG) 105 148 gl.glEnableClientState(gl.GL_FOG_COORDINATE_ARRAY_EXT) … … 110 153 gl.glHint(gl.GL_FOG_HINT, gl.GL_NICEST) 111 154 gl.glFogi(gl.GL_FOG_COORDINATE_SOURCE_EXT, gl.GL_FOG_COORDINATE_EXT) 112 gl.glPushMatrix()113 gl.glTranslatef(-pos[0],-pos[1], -pos[2])114 155 # 115 156 # We need not _iterStart here since _bodies is already iterating via Scene … … 124 165 _body._scene._bodies._list[_i])._model._render( 125 166 (<soy.bodies.Body> _body._scene._bodies._list[_i])) 126 gl.glPopMatrix()127 167 gl.glDisableClientState(gl.GL_FOG_COORDINATE_ARRAY_EXT) 128 168 gl.glDisable(gl.GL_FOG) 129 169 # 130 #RENDER SURFACE 170 ###################################### 171 # 172 # save current matix before setting it 173 # 174 gl.glPushMatrix() 175 gl.glMultMatrixf(_mtx) 131 176 self._material._coreBind() 132 177 self._renderSurf() 133 178 self._material._coreUnBind() 134 179 gl.glDisable(gl.GL_STENCIL_TEST) 180 # 181 ###################################### 182 # 183 # return to camera matrix 184 # 185 gl.glPopMatrix() 186 # 187 ###################################### 135 188 136 189
