2package com.jogamp.opengl.test.junit.jogl.demos.gl2;
4import com.jogamp.opengl.GL;
5import com.jogamp.opengl.GL2;
6import com.jogamp.opengl.GL2ES3;
7import com.jogamp.opengl.GL2GL3;
8import com.jogamp.opengl.GLAutoDrawable;
9import com.jogamp.opengl.GLEventListener;
10import com.jogamp.opengl.GLProfile;
11import com.jogamp.opengl.fixedfunc.GLLightingFunc;
12import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
14import com.jogamp.newt.Window;
15import com.jogamp.newt.event.InputEvent;
16import com.jogamp.newt.event.KeyAdapter;
17import com.jogamp.newt.event.KeyEvent;
18import com.jogamp.newt.event.KeyListener;
19import com.jogamp.newt.event.MouseAdapter;
20import com.jogamp.newt.event.MouseEvent;
21import com.jogamp.newt.event.MouseListener;
22import com.jogamp.newt.event.awt.AWTKeyAdapter;
23import com.jogamp.newt.event.awt.AWTMouseAdapter;
24import com.jogamp.opengl.GLRendererQuirks;
25import com.jogamp.opengl.JoglVersion;
26import com.jogamp.opengl.util.TileRendererBase;
35 private float view_rotx = 20.0f, view_roty = 30.0f;
36 private final float view_rotz = 0.0f;
37 private int gear1=0, gear2=0, gear3=0;
38 private Gears sharedGears =
null;
39 private Object syncObjects =
null;
40 private float angle = 0.0f;
41 private boolean doRotate =
true;
42 private final int swapInterval;
43 private final MouseListener gearsMouse =
new GearsMouseAdapter();
44 private final KeyListener gearsKeys =
new GearsKeyAdapter();
46 private boolean doRotateBeforePrinting;
47 private boolean verbose =
true;
48 private boolean flipVerticalInGLOrientation =
false;
49 private volatile boolean isInit =
false;
52 private int prevMouseX, prevMouseY;
54 public Gears(
final int swapInterval) {
55 this.swapInterval = swapInterval;
59 this.swapInterval = 1;
64 tileRendererInUse = tr;
65 doRotateBeforePrinting = doRotate;
70 tileRendererInUse =
null;
75 System.err.println(
"Gears.startTileRendering: "+tr);
79 System.err.println(
"Gears.endTileRendering: "+tr);
111 if (upstreamWidget instanceof
Window) {
115 }
else if (
GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
116 final java.awt.Component comp = (java.awt.Component) upstreamWidget;
125 boolean enableCullFace =
false;
127 private void enableStates(
final GL gl,
final boolean enable) {
130 if( enableCullFace ) {
133 gl.
glEnable(GLLightingFunc.GL_LIGHTING);
134 gl.
glEnable(GLLightingFunc.GL_LIGHT0);
137 gl.
glEnable(GLLightingFunc.GL_NORMALIZE);
142 if( enableCullFace ) {
145 gl.
glDisable(GLLightingFunc.GL_LIGHTING);
148 gl.
glDisable(GLLightingFunc.GL_NORMALIZE);
156 if(
null != sharedGears && !sharedGears.isInit() ) {
158 System.err.println(Thread.currentThread()+
" GearsES1.init.0: pending shared Gears .. re-init later XXXXX");
162 final float lightPos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
163 final float red[] = { 0.8f, 0.1f, 0.0f, 0.7f };
164 final float green[] = { 0.0f, 0.8f, 0.2f, 0.7f };
165 final float blue[] = { 0.2f, 0.2f, 1.0f, 0.7f };
167 System.err.println(Thread.currentThread()+
" Gears.init: tileRendererInUse "+tileRendererInUse);
169 System.err.println(
"GearsES2 init on "+Thread.currentThread());
171 System.err.println(
"INIT GL IS: " + gl.getClass().getName());
178 enableCullFace =
true;
180 enableCullFace =
false;
182 enableStates(gl,
true);
185 if(
null != sharedGears ) {
190 System.err.println(
"gear1 list reused: "+gear1);
191 System.err.println(
"gear2 list reused: "+gear2);
192 System.err.println(
"gear3 list reused: "+gear3);
195 syncObjects = sharedGears;
200 syncObjects =
new Object();
202 System.err.println(
"Shared Gears: Unsynchronized Objects");
209 gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
212 System.err.println(
"gear1 list created: "+gear1);
218 gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
221 System.err.println(
"gear2 list created: "+gear2);
227 gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
230 System.err.println(
"gear3 list created: "+gear3);
233 syncObjects =
new Object();
236 enableStates(gl,
false);
246 if( !isInit ) {
return; }
249 reshape(gl, x, y, width, height, width, height);
254 final int tileX,
final int tileY,
final int tileWidth,
final int tileHeight,
255 final int imageWidth,
final int imageHeight) {
256 if( !isInit ) {
return; }
259 reshape(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
262 public void reshape(
final GL2 gl,
final int tileX,
final int tileY,
final int tileWidth,
final int tileHeight,
final int imageWidth,
final int imageHeight) {
264 System.err.println(Thread.currentThread()+
" Gears.reshape "+tileX+
"/"+tileY+
" "+tileWidth+
"x"+tileHeight+
" of "+imageWidth+
"x"+imageHeight+
", swapInterval "+swapInterval+
", drawable 0x"+Long.toHexString(gl.
getContext().
getGLDrawable().
getHandle())+
", tileRendererInUse "+tileRendererInUse);
268 float left, right, bottom, top;
269 if( imageHeight > imageWidth ) {
270 final float a = (float)imageHeight / (
float)imageWidth;
276 final float a = (float)imageWidth / (
float)imageHeight;
282 final float w = right - left;
283 final float h = top - bottom;
286 final float l = left + tileX * w / imageWidth;
287 final float r = l + tileWidth * w / imageWidth;
289 final float b = bottom + tileY * h / imageHeight;
290 final float t = b + tileHeight * h / imageHeight;
292 final float _w = r - l;
293 final float _h = t - b;
295 System.err.println(
">> Gears angle "+angle+
", [l "+left+
", r "+right+
", b "+bottom+
", t "+top+
"] "+w+
"x"+h+
" -> [l "+l+
", r "+r+
", b "+b+
", t "+t+
"] "+_w+
"x"+_h+
", v-flip "+flipVerticalInGLOrientation);
312 if( !isInit ) {
return; }
315 System.err.println(Thread.currentThread()+
" Gears.dispose: tileRendererInUse "+tileRendererInUse);
319 if (upstreamWidget instanceof
Window) {
324 }
catch (
final Exception e) { System.err.println(
"Caught: "); e.printStackTrace(); }
334 if( !isInit ) {
return; }
339 enableStates(gl,
true);
341 if(
null == tileRendererInUse ) {
350 (drawable instanceof com.jogamp.opengl.awt.GLJPanel) &&
351 !((com.jogamp.opengl.awt.GLJPanel) drawable).isOpaque() &&
352 ((com.jogamp.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) {
359 enableStates(gl,
false);
363 if( !isInit ) {
return; }
364 enableStates(gl,
true);
366 if(
null == tileRendererInUse ) {
374 enableStates(gl,
false);
377 private void displayImpl(
final GL2 gl) {
385 gl.
glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
386 gl.
glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
387 gl.
glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
390 synchronized ( syncObjects ) {
400 gl.
glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
407 gl.
glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
418 final float inner_radius,
419 final float outer_radius,
422 final float tooth_depth)
430 r1 = outer_radius - tooth_depth / 2.0f;
431 r2 = outer_radius + tooth_depth / 2.0f;
433 da = 2.0f * (float) Math.PI / teeth / 4.0f;
441 for (i = 0; i <= teeth; i++)
443 angle = i * 2.0f * (float) Math.PI / teeth;
444 gl.
glVertex3f(r0 * (
float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
445 gl.
glVertex3f(r1 * (
float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
448 gl.
glVertex3f(r0 * (
float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
449 gl.
glVertex3f(r1 * (
float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
456 for (i = 0; i < teeth; i++)
458 angle = i * 2.0f * (float) Math.PI / teeth;
459 gl.
glVertex3f(r1 * (
float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
460 gl.
glVertex3f(r2 * (
float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
461 gl.
glVertex3f(r2 * (
float)Math.cos(angle + 2.0f * da), r2 * (float)Math.sin(angle + 2.0f * da), width * 0.5f);
462 gl.
glVertex3f(r1 * (
float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
468 for (i = 0; i <= teeth; i++)
470 angle = i * 2.0f * (float) Math.PI / teeth;
471 gl.
glVertex3f(r1 * (
float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
472 gl.
glVertex3f(r0 * (
float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
473 gl.
glVertex3f(r1 * (
float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
474 gl.
glVertex3f(r0 * (
float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
480 for (i = 0; i < teeth; i++)
482 angle = i * 2.0f * (float) Math.PI / teeth;
483 gl.
glVertex3f(r1 * (
float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
484 gl.
glVertex3f(r2 * (
float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
485 gl.
glVertex3f(r2 * (
float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
486 gl.
glVertex3f(r1 * (
float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
492 for (i = 0; i < teeth; i++)
494 angle = i * 2.0f * (float) Math.PI / teeth;
495 gl.
glVertex3f(r1 * (
float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
496 gl.
glVertex3f(r1 * (
float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
497 u = r2 * (float)Math.cos(angle + da) - r1 * (float)Math.cos(angle);
498 v = r2 * (float)Math.sin(angle + da) - r1 * (float)Math.sin(angle);
499 len = (float)Math.sqrt(u * u + v * v);
503 gl.
glVertex3f(r2 * (
float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
504 gl.
glVertex3f(r2 * (
float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
505 gl.
glNormal3f((
float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
506 gl.
glVertex3f(r2 * (
float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), width * 0.5f);
507 gl.
glVertex3f(r2 * (
float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
508 u = r1 * (float)Math.cos(angle + 3 * da) - r2 * (float)Math.cos(angle + 2 * da);
509 v = r1 * (float)Math.sin(angle + 3 * da) - r2 * (float)Math.sin(angle + 2 * da);
511 gl.
glVertex3f(r1 * (
float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), width * 0.5f);
512 gl.
glVertex3f(r1 * (
float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
513 gl.
glNormal3f((
float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
515 gl.
glVertex3f(r1 * (
float)Math.cos(0), r1 * (float)Math.sin(0), width * 0.5f);
516 gl.
glVertex3f(r1 * (
float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
523 for (i = 0; i <= teeth; i++)
525 angle = i * 2.0f * (float) Math.PI / teeth;
526 gl.
glNormal3f(-(
float)Math.cos(angle), -(float)Math.sin(angle), 0.0f);
527 gl.
glVertex3f(r0 * (
float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
528 gl.
glVertex3f(r0 * (
float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
534 public void keyPressed(
final KeyEvent e) {
538 }
else if(KeyEvent.VK_RIGHT == kc) {
540 }
else if(KeyEvent.VK_UP == kc) {
542 }
else if(KeyEvent.VK_DOWN == kc) {
548 class GearsMouseAdapter
extends MouseAdapter {
549 public void mousePressed(
final MouseEvent e) {
550 prevMouseX = e.getX();
551 prevMouseY = e.getY();
552 if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
557 public void mouseReleased(
final MouseEvent e) {
558 if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
563 public void mouseDragged(
final MouseEvent e) {
564 final int x = e.getX();
565 final int y = e.getY();
566 int width=0, height=0;
567 final Object source = e.getSource();
568 if(source instanceof Window) {
569 final Window window = (Window) source;
570 width=window.getSurfaceWidth();
571 height=window.getSurfaceHeight();
572 }
else if (source instanceof GLAutoDrawable) {
573 final GLAutoDrawable glad = (GLAutoDrawable) source;
574 width = glad.getSurfaceWidth();
575 height = glad.getSurfaceHeight();
576 }
else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
577 final java.awt.Component comp = (java.awt.Component) source;
578 width=comp.getWidth();
579 height=comp.getHeight();
581 throw new RuntimeException(
"Event source neither Window nor Component: "+source);
583 final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
584 final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
static final short VK_LEFT
Constant for the cursor- or numerical-pad left arrow key.
final short getKeyCode()
Returns the virtual key code using a fixed mapping to the US keyboard layout.
AWT: printable: PRESSED (t0), TYPED (t0), RELEASED (t1) non-printable: PRESSED (t0),...
synchronized AWTAdapter addTo(final java.awt.Component awtComponent)
Due to the fact that some NEWT com.jogamp.newt.event.NEWTEventListener are mapped to more than one ja...
synchronized AWTAdapter addTo(final java.awt.Component awtComponent)
Due to the fact that some NEWT com.jogamp.newt.event.NEWTEventListener are mapped to more than one ja...
abstract GLDrawable getGLDrawable()
Returns the write-drawable this context uses for framebuffer operations.
final boolean hasRendererQuirk(final int quirk)
Returns true if the quirk exist in getRendererQuirks(), otherwise false.
Specifies the the OpenGL profile.
GLRendererQuirks contains information of known bugs of various GL renderer.
static final int NeedSharedObjectSync
Need GL objects (VBO, ..) to be synchronized when utilized concurrently from multiple threads via a s...
final StringBuilder toString(StringBuilder sb)
static StringBuilder getGLStrings(final GL gl, final StringBuilder sb)
Gears.java author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel)
void setSharedGears(final Gears shared)
void reshape(final GL2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight)
void reshapeTile(final TileRendererBase tr, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight)
Called by the TileRendererBase during tile-rendering via an attached GLAutoDrawable's GLAutoDrawable#...
void removeTileRendererNotify(final TileRendererBase tr)
The owning GLAutoDrawable is detached from the given TileRendererBase instance.
void setDoRotation(final boolean rotate)
void dispose(final GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL resources per GLContext,...
void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height)
Called by the drawable during the first repaint after the component has been resized.
boolean init(final GL2 gl)
void addTileRendererNotify(final TileRendererBase tr)
The owning GLAutoDrawable is attached to the given TileRendererBase instance.
Gears(final int swapInterval)
static void gear(final GL2 gl, final float inner_radius, final float outer_radius, final float width, final int teeth, final float tooth_depth)
void display(final GL2 gl)
void init(final GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.
void startTileRendering(final TileRendererBase tr)
Called by the TileRendererBase during tile-rendering after TileRendererBase#beginTile(GL) and before ...
void setFlipVerticalInGLOrientation(final boolean v)
void display(final GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.
void endTileRendering(final TileRendererBase tr)
Called by the TileRenderer during tile-rendering after TileRendererBase#endTile(GL) and GLAutoDrawabl...
void setVerbose(final boolean v)
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d....
final GLAutoDrawable getAttachedDrawable()
Returns a previously attached GLAutoDrawable, null if none is attached.
Specifying NEWT's Window functionality:
void addKeyListener(KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
void removeKeyListener(KeyListener l)
void addMouseListener(MouseListener l)
Appends the given MouseListener to the end of the list.
void removeMouseListener(MouseListener l)
Removes the given MouseListener from the list.
Listener for MouseEvents.
void glNormal3f(float nx, float ny, float nz)
Entry point to C language function: void {@native glNormal3f}(GLfloat nx, GLfloat ny,...
void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
static final int GL_QUADS
GL_ES_VERSION_3_2, GL_VERSION_1_1, GL_VERSION_1_0, GL_OES_tessellation_shader, GL_EXT_tessellation_sh...
int glGenLists(int range)
Entry point to C language function: GLuint {@native glGenLists}(GLsizei range) Part of GL_VERSION_...
void glCallList(int list)
Entry point to C language function: void {@native glCallList}(GLuint list) Part of GL_VERSION_1_0
void glBegin(int mode)
Entry point to C language function: void {@native glBegin}(GLenum mode) Part of GL_VERSION_1_0
void glEndList()
Entry point to C language function: void {@native glEndList}() Part of GL_VERSION_1_0
void glVertex3f(float x, float y, float z)
Entry point to C language function: void {@native glVertex3f}(GLfloat x, GLfloat y,...
static final int GL_COMPILE
GL_VERSION_1_0 Define "GL_COMPILE" with expression '0x1300', CType: int
void glEnd()
Entry point to C language function: void {@native glEnd}() Part of GL_VERSION_1_0
static final int GL_QUAD_STRIP
GL_VERSION_1_0 Define "GL_QUAD_STRIP" with expression '0x0008', CType: int
void glNewList(int list, int mode)
Entry point to C language function: void {@native glNewList}(GLuint list, GLenum mode) Part of GL_...
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void setGLEventListenerInitState(GLEventListener listener, boolean initialized)
Sets the given listener's initialized state.
Object getUpstreamWidget()
Method may return the upstream UI toolkit object holding this GLAutoDrawable instance,...
void setSwapInterval(int interval)
Set the swap interval of the current context and attached onscreen GLDrawable.
GLContext getContext()
Returns the GLContext associated which this GL object.
GL2 getGL2()
Casts this object to the GL2 interface.
boolean getSampleBuffers()
Returns whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawab...
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
long getHandle()
Returns the GL drawable handle, guaranteed to be valid after realization and while it's surface is be...
boolean isGLOriented()
Returns true if the drawable is rendered in OpenGL's coordinate system, origin at bottom left.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
static final int GL_MULTISAMPLE
Common in ES1, GL2 and GL3.
void glDisable(int cap)
Entry point to C language function: void {@native glDisable}(GLenum cap) Part of GL_ES_VERSION_2_0...
static final int GL_COLOR_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_COLOR_BUFFER_BIT" wit...
void glClearColor(float red, float green, float blue, float alpha)
Entry point to C language function: void {@native glClearColor}(GLfloat red, GLfloat green,...
void glEnable(int cap)
Entry point to C language function: void {@native glEnable}(GLenum cap) Part of GL_ES_VERSION_2_0,...
static final int GL_DEPTH_TEST
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_TEST" with expr...
void glClear(int mask)
Entry point to C language function: void {@native glClear}(GLbitfield mask) Part of GL_ES_VERSION_...
static final int GL_FRONT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_FRONT" with expressio...
static final int GL_DEPTH_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_BUFFER_BIT" wit...
static final int GL_LESS
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_LESS" with expression...
static final int GL_CULL_FACE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_CULL_FACE" with expre...
void glDepthFunc(int func)
Entry point to C language function: void {@native glDepthFunc}(GLenum func) Part of GL_ES_VERSION_...
void glMaterialfv(int face, int pname, java.nio.FloatBuffer params)
static final int GL_SMOOTH
static final int GL_POSITION
static final int GL_AMBIENT_AND_DIFFUSE
void glLightfv(int light, int pname, java.nio.FloatBuffer params)
static final int GL_LIGHT0
void glShadeModel(int mode)
Subset of OpenGL fixed function pipeline's matrix operations.
static final int GL_PROJECTION
Matrix mode projection.
void glPushMatrix()
Push the current matrix to it's stack, while preserving it's values.
void glPopMatrix()
Pop the current matrix from it's stack.
void glTranslatef(float x, float y, float z)
Translate the current matrix.
void glRotatef(float angle, float x, float y, float z)
Rotate the current matrix.
static final int GL_MODELVIEW
Matrix mode modelview.
void glScalef(float x, float y, float z)
Scale the current matrix.
void glLoadIdentity()
Load the current matrix with the identity matrix.
void glMatrixMode(int mode)
Sets the current matrix mode.