61
61
% 21-Jan-2006 -- Modified for use with OpenGL-Psychtoolbox (MK)
62
62
% 16-Feb-2006 -- Modified for use with new MOGL (MK)
63
63
% 05-Mar-2006 -- Cleaned up for public consumption (MK)
64
% 06-Apr-2013 -- Make compatible with OpenGL-ES1.1. (MK)
65
66
% Is the script running in OpenGL Psychtoolbox?
183
184
% Setup cubes rotation around axis:
185
glRotated(theta,rotatev(1),rotatev(2),rotatev(3));
186
glRotatef(theta,rotatev(1),rotatev(2),rotatev(3));
187
188
% Clear out the backbuffer: This also cleans the depth-buffer for
188
189
% proper occlusion handling:
243
244
% Bind (Select) texture 'tx' for drawing:
244
245
glBindTexture(GL.TEXTURE_2D,tx);
245
% Begin drawing of a new polygon:
247
% Begin drawing of a new quad:
248
250
% Assign n as normal vector for this polygons surface normal:
251
glNormal3f(n(1), n(2), n(3));
251
253
% Define vertex 1 by assigning a texture coordinate and a 3D position:
252
glTexCoord2dv([ 0 0 ]);
253
glVertex3dv(v(:,i(1)));
255
glVertex3f(v(1,i(1)),v(2,i(1)),v(3,i(1)));
254
256
% Define vertex 2 by assigning a texture coordinate and a 3D position:
255
glTexCoord2dv([ 1 0 ]);
256
glVertex3dv(v(:,i(2)));
258
glVertex3f(v(1,i(2)),v(2,i(2)),v(3,i(2)));
257
259
% Define vertex 3 by assigning a texture coordinate and a 3D position:
258
glTexCoord2dv([ 1 1 ]);
259
glVertex3dv(v(:,i(3)));
261
glVertex3f(v(1,i(3)),v(2,i(3)),v(3,i(3)));
260
262
% Define vertex 4 by assigning a texture coordinate and a 3D position:
261
glTexCoord2dv([ 0 1 ]);
262
glVertex3dv(v(:,i(4)));
264
glVertex3f(v(1,i(4)),v(2,i(4)),v(3,i(4)));
263
265
% Done with this polygon: