Skip to main content

Rotating Image Along Y axis in JOGL so that it is horizontal (Visible side faces upward)

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
Rizwan606
Offline
Joined: 2011-08-05
Points: 0

I am new to JOGL and have tried to display an image in JOGL from an example.

http://wiki.tankaar.com/index.php?title=Displaying_an_Image_in_JOGL_%28Part_1%29

However , this example displays the image in 2D, with the right side facing the user(i-e leaf is visible to user), **I wanted to change the code so that i can rotate the image along Y-axis, so that leaf is facing upwards and is not visible to user, and if i rotate it 30 degrees,

(gl.glRotated(30, 0, 1, 0);)

some part of image should be visible to user.** ,Below is the changing that i have done in the code, but it does not show the image, can any one tell me what am i doing wrong here.. Any Help will be GREATLY Appreciated, Thanks

[prettify]<span class="pln">java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="typ">Graphics2D</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">color</span><span class="pun">.</span><span class="typ">ColorSpace</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">image</span><span class="pun">.</span><span class="typ">BufferedImage</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">image</span><span class="pun">.</span><span class="typ">ComponentColorModel</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">image</span><span class="pun">.</span><span class="typ">DataBuffer</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">image</span><span class="pun">.</span><span class="typ">DataBufferByte</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">image</span><span class="pun">.</span><span class="typ">Raster</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">image</span><span class="pun">.</span><span class="typ">WritableRaster</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">IOException</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">nio</span><span class="pun">.</span><span class="typ">ByteBuffer</span><span class="pun">;</span><span class="pln"><br /><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">imageio</span><span class="pun">.</span><span class="typ">ImageIO</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">media</span><span class="pun">.</span><span class="pln">opengl</span><span class="pun">.</span><span class="pln">GL</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">media</span><span class="pun">.</span><span class="pln">opengl</span><span class="pun">.</span><span class="typ">GLAutoDrawable</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">media</span><span class="pun">.</span><span class="pln">opengl</span><span class="pun">.</span><span class="typ">GLCanvas</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">media</span><span class="pun">.</span><span class="pln">opengl</span><span class="pun">.</span><span class="typ">GLDrawable</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">media</span><span class="pun">.</span><span class="pln">opengl</span><span class="pun">.</span><span class="typ">GLEventListener</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JFrame</span><span class="pun">;</span><span class="pln"><br /></span><span class="com">//import net.java.games.jogl.GL;</span><span class="pln"><br /></span><span class="com">//import net.java.games.jogl.GLCanvas;</span><span class="pln"><br /></span><span class="com">//import net.java.games.jogl.GLDrawable;</span><span class="pln"><br /></span><span class="com">//import net.java.games.jogl.GLEventListener;</span><span class="pln"><br /><br /></span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">Image3DGraphics</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />    </span><span class="kwd">public</span><span class="pln"> </span><span class="typ">Image3DGraphics</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />        </span><span class="typ">JFrame</span><span class="pln"> frame </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JFrame</span><span class="pun">(</span><span class="str">"2D Graphics"</span><span class="pun">);</span><span class="pln"><br />        frame</span><span class="pun">.</span><span class="pln">setSize</span><span class="pun">(</span><span class="lit">800</span><span class="pun">,</span><span class="lit">900</span><span class="pun">);</span><span class="pln"><br />        frame</span><span class="pun">.</span><span class="pln">setDefaultCloseOperation</span><span class="pun">(</span><span class="typ">JFrame</span><span class="pun">.</span><span class="pln">EXIT_ON_CLOSE</span><span class="pun">);</span><span class="pln"><br />        </span><span class="typ">GLCanvas</span><span class="pln"> canvas </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">GLCanvas</span><span class="pun">();</span><span class="pln"><br />        canvas</span><span class="pun">.</span><span class="pln">addGLEventListener</span><span class="pun">((</span><span class="typ">GLEventListener</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JOGLListener</span><span class="pun">());</span><span class="pln"><br />        frame</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">canvas</span><span class="pun">);</span><span class="pln"><br />        frame</span><span class="pun">.</span><span class="pln">setVisible</span><span class="pun">(</span><span class="kwd">true</span><span class="pun">);</span><span class="pln"><br />    </span><span class="pun">}</span><span class="pln"><br />    </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> main</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> args</span><span class="pun">[]){</span><span class="pln"><br />        </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Image3DGraphics</span><span class="pun">();</span><span class="pln"><br />    </span><span class="pun">}</span><span class="pln"><br /><br />    </span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">JOGLListener</span><span class="pln"> </span><span class="kwd">implements</span><span class="pln"> </span><span class="typ">GLEventListener</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br /><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> display</span><span class="pun">(</span><span class="typ">GLAutoDrawable</span><span class="pln"> drawable</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"DISPLAY CALLED"</span><span class="pun">);</span><span class="pln"><br />            GL gl </span><span class="pun">=</span><span class="pln"> drawable</span><span class="pun">.</span><span class="pln">getGL</span><span class="pun">();</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glMatrixMode</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_PROJECTION</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glLoadIdentity</span><span class="pun">();</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glOrtho</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">300</span><span class="pun">,</span><span class="pln"> </span><span class="lit">300</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glMatrixMode</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_MODELVIEW</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glDisable</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_DEPTH_TEST</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glClearColor</span><span class="pun">(</span><span class="lit">0.0f</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0.0f</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0.0f</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0.0f</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glClear</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_COLOR_BUFFER_BIT</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glBlendFunc </span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_SRC_ALPHA</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_ONE_MINUS_SRC_ALPHA</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glEnable </span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_BLEND</span><span class="pun">);</span><span class="pln"><br />            </span><span class="typ">BufferedImage</span><span class="pln"> bufferedImage </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln"><br />            </span><span class="kwd">int</span><span class="pln"> w </span><span class="pun">=</span><span class="pln"> </span><span class="lit">10</span><span class="pun">;</span><span class="pln"><br />            </span><span class="kwd">int</span><span class="pln"> h </span><span class="pun">=</span><span class="pln"> </span><span class="lit">10</span><span class="pun">;</span><span class="pln"><br />                        </span><span class="kwd">int</span><span class="pln"> d</span><span class="pun">=</span><span class="lit">10</span><span class="pun">;</span><span class="pln"><br />            </span><span class="kwd">try</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />                bufferedImage </span><span class="pun">=</span><span class="pln"> </span><span class="typ">ImageIO</span><span class="pun">.</span><span class="pln">read</span><span class="pun">(</span><span class="typ">Image3DGraphics</span><span class="pun">.</span><span class="kwd">class</span><span class="pun">.</span><span class="pln">getResource</span><span class="pun">(</span><span class="str">"leaf.png"</span><span class="pun">));</span><span class="pln"><br />                w </span><span class="pun">=</span><span class="pln"> bufferedImage</span><span class="pun">.</span><span class="pln">getWidth</span><span class="pun">();</span><span class="pln"><br />                h </span><span class="pun">=</span><span class="pln"> bufferedImage</span><span class="pun">.</span><span class="pln">getHeight</span><span class="pun">();</span><span class="pln"><br />                                d </span><span class="pun">=</span><span class="pln"> bufferedImage</span><span class="pun">.</span><span class="pln">getWidth</span><span class="pun">();</span><span class="pln"><br />            </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">IOException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />                e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln"><br />            </span><span class="pun">}</span><span class="pln"><br />            </span><span class="typ">WritableRaster</span><span class="pln"> raster </span><span class="pun">=</span><span class="pln"><br />                </span><span class="typ">Raster</span><span class="pun">.</span><span class="pln">createInterleavedRaster </span><span class="pun">(</span><span class="typ">DataBuffer</span><span class="pun">.</span><span class="pln">TYPE_BYTE</span><span class="pun">,</span><span class="pln"><br />                        w</span><span class="pun">,</span><span class="pln"><br />                        h</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="lit">4</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="kwd">null</span><span class="pun">);</span><span class="pln"><br />            </span><span class="typ">ComponentColorModel</span><span class="pln"> colorModel</span><span class="pun">=</span><span class="pln"><br />                </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">ComponentColorModel</span><span class="pln"> </span><span class="pun">(</span><span class="typ">ColorSpace</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">(</span><span class="typ">ColorSpace</span><span class="pun">.</span><span class="pln">CS_sRGB</span><span class="pun">),</span><span class="pln"><br />                        </span><span class="kwd">new</span><span class="pln"> </span><span class="kwd">int</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">{</span><span class="lit">8</span><span class="pun">,</span><span class="lit">8</span><span class="pun">,</span><span class="lit">8</span><span class="pun">,</span><span class="lit">8</span><span class="pun">},</span><span class="pln"><br />                        </span><span class="kwd">true</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="kwd">false</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="typ">ComponentColorModel</span><span class="pun">.</span><span class="pln">TRANSLUCENT</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="typ">DataBuffer</span><span class="pun">.</span><span class="pln">TYPE_BYTE</span><span class="pun">);</span><span class="pln"><br />            </span><span class="typ">BufferedImage</span><span class="pln"> dukeImg </span><span class="pun">=</span><span class="pln"><br />                </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">BufferedImage</span><span class="pln"> </span><span class="pun">(</span><span class="pln">colorModel</span><span class="pun">,</span><span class="pln"><br />                        raster</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="kwd">false</span><span class="pun">,</span><span class="pln"><br />                        </span><span class="kwd">null</span><span class="pun">);</span><span class="pln"><br /><br />            </span><span class="typ">Graphics2D</span><span class="pln"> g </span><span class="pun">=</span><span class="pln"> dukeImg</span><span class="pun">.</span><span class="pln">createGraphics</span><span class="pun">();</span><span class="pln"><br />            g</span><span class="pun">.</span><span class="pln">drawImage</span><span class="pun">(</span><span class="pln">bufferedImage</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">);</span><span class="pln"><br />            </span><span class="typ">DataBufferByte</span><span class="pln"> dukeBuf </span><span class="pun">=</span><span class="pln"><br />                </span><span class="pun">(</span><span class="typ">DataBufferByte</span><span class="pun">)</span><span class="pln">raster</span><span class="pun">.</span><span class="pln">getDataBuffer</span><span class="pun">();</span><span class="pln"><br />            </span><span class="kwd">byte</span><span class="pun">[]</span><span class="pln"> dukeRGBA </span><span class="pun">=</span><span class="pln"> dukeBuf</span><span class="pun">.</span><span class="pln">getData</span><span class="pun">();</span><span class="pln"><br />            </span><span class="typ">ByteBuffer</span><span class="pln"> bb </span><span class="pun">=</span><span class="pln"> </span><span class="typ">ByteBuffer</span><span class="pun">.</span><span class="pln">wrap</span><span class="pun">(</span><span class="pln">dukeRGBA</span><span class="pun">);</span><span class="pln"><br />            bb</span><span class="pun">.</span><span class="pln">position</span><span class="pun">(</span><span class="lit">0</span><span class="pun">);</span><span class="pln"><br />            bb</span><span class="pun">.</span><span class="pln">mark</span><span class="pun">();</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glBindTexture</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> </span><span class="lit">13</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glPixelStorei</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_UNPACK_ALIGNMENT</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexParameteri</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_WRAP_S</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_CLAMP</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexParameteri</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_WRAP_T</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_CLAMP</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexParameteri</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_MAG_FILTER</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_LINEAR</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexParameteri</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_MIN_FILTER</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_LINEAR</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexEnvf</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_ENV</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_ENV_MODE</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_REPLACE</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexImage3D </span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_RGBA</span><span class="pun">,</span><span class="pln"> w</span><span class="pun">,</span><span class="pln"> h</span><span class="pun">,</span><span class="pln"> d</span><span class="pun">,</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> GL</span><span class="pun">.</span><span class="pln">GL_RGBA</span><span class="pun">,</span><span class="pln"><br />                    GL</span><span class="pun">.</span><span class="pln">GL_UNSIGNED_BYTE</span><span class="pun">,</span><span class="pln"> bb</span><span class="pun">);</span><span class="pln"><br /><br />            </span><span class="kwd">int</span><span class="pln"> left </span><span class="pun">=</span><span class="pln"> </span><span class="lit">100</span><span class="pun">;</span><span class="pln"><br />            </span><span class="kwd">int</span><span class="pln"> top </span><span class="pun">=</span><span class="pln"> </span><span class="lit">100</span><span class="pun">;</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glEnable</span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glBindTexture </span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_TEXTURE_3D</span><span class="pun">,</span><span class="pln"> </span><span class="lit">13</span><span class="pun">);</span><span class="pln"><br /><br /><br /></span><span class="com">//                        gl.glPushMatrix();</span><span class="pln"><br /></span><span class="com">//          gl.glTranslated(100, 100, 0);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glRotated</span><span class="pun">(</span><span class="lit">30</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">);</span><span class="pln"><br /></span><span class="com">//          gl.glTranslated(-100, -100, 0);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glBegin </span><span class="pun">(</span><span class="pln">GL</span><span class="pun">.</span><span class="pln">GL_POLYGON</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexCoord3d </span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="lit">0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glVertex3d </span><span class="pun">(</span><span class="pln">left</span><span class="pun">,</span><span class="pln">top</span><span class="pun">,</span><span class="lit">0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexCoord3d</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="lit">0</span><span class="pun">,</span><span class="lit">0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glVertex3d </span><span class="pun">(</span><span class="pln">left </span><span class="pun">+</span><span class="pln"> w</span><span class="pun">,</span><span class="pln"> top</span><span class="pun">,</span><span class="lit">0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexCoord3d</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="lit">1</span><span class="pun">,+</span><span class="lit">1.0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glVertex3d </span><span class="pun">(</span><span class="pln">left </span><span class="pun">+</span><span class="pln"> w</span><span class="pun">,</span><span class="pln"> top </span><span class="pun">+</span><span class="pln"> h</span><span class="pun">,+</span><span class="lit">1.0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glTexCoord3d</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="lit">1</span><span class="pun">,+</span><span class="lit">1.0</span><span class="pun">);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glVertex3d </span><span class="pun">(</span><span class="pln">left</span><span class="pun">,</span><span class="pln"> top </span><span class="pun">+</span><span class="pln"> h</span><span class="pun">,+</span><span class="lit">1.0</span><span class="pun">);</span><span class="pln"><br /></span><span class="com">//                        gl.glTexCoord2d (0, 0);</span><span class="pln"><br /></span><span class="com">//          gl.glVertex2d (left,top);</span><span class="pln"><br /></span><span class="com">//          gl.glTexCoord2d(1,0);</span><span class="pln"><br /></span><span class="com">//          gl.glVertex2d (left + w, top);</span><span class="pln"><br /></span><span class="com">//          gl.glTexCoord2d(1,1);</span><span class="pln"><br /></span><span class="com">//          gl.glVertex2d (left + w, top + h);</span><span class="pln"><br /></span><span class="com">//          gl.glTexCoord2d(0,1);</span><span class="pln"><br /></span><span class="com">//          gl.glVertex2d (left, top + h);</span><span class="pln"><br />            gl</span><span class="pun">.</span><span class="pln">glEnd </span><span class="pun">();</span><span class="pln"><br /><br />            gl</span><span class="pun">.</span><span class="pln">glFlush</span><span class="pun">();</span><span class="pln"><br /><br /><br />        </span><span class="pun">}</span><span class="pln"><br /><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> displayChanged</span><span class="pun">(</span><span class="typ">GLAutoDrawable</span><span class="pln"> arg0</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">boolean</span><span class="pln"> arg1</span><span class="pun">,</span><span class="pln"><br />                </span><span class="kwd">boolean</span><span class="pln"> arg2</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"DISPLAY CHANGED CALLED"</span><span class="pun">);</span><span class="pln"><br />        </span><span class="pun">}</span><span class="pln"><br /><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> init</span><span class="pun">(</span><span class="typ">GLAutoDrawable</span><span class="pln"> drawable</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"INIT CALLED"</span><span class="pun">);</span><span class="pln"><br />        </span><span class="pun">}</span><span class="pln"><br /><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> reshape</span><span class="pun">(</span><span class="typ">GLAutoDrawable</span><span class="pln"> arg0</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> arg1</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> arg2</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> arg3</span><span class="pun">,</span><span class="pln"><br />                </span><span class="kwd">int</span><span class="pln"> arg4</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"RESHAPE CALLED"</span><span class="pun">);</span><span class="pln"><br /><br />        </span><span class="pun">}</span><span class="pln"><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> init</span><span class="pun">(</span><span class="typ">GLDrawable</span><span class="pln"> gld</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="kwd">throw</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">UnsupportedOperationException</span><span class="pun">(</span><span class="str">"Not supported yet."</span><span class="pun">);</span><span class="pln"><br />        </span><span class="pun">}</span><span class="pln"><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> display</span><span class="pun">(</span><span class="typ">GLDrawable</span><span class="pln"> gld</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="kwd">throw</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">UnsupportedOperationException</span><span class="pun">(</span><span class="str">"Not supported yet."</span><span class="pun">);</span><span class="pln"><br />        </span><span class="pun">}</span><span class="pln"><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> reshape</span><span class="pun">(</span><span class="typ">GLDrawable</span><span class="pln"> gld</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> i</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> i1</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> i2</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> i3</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="kwd">throw</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">UnsupportedOperationException</span><span class="pun">(</span><span class="str">"Not supported yet."</span><span class="pun">);</span><span class="pln"><br />        </span><span class="pun">}</span><span class="pln"><br /><br />        </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> displayChanged</span><span class="pun">(</span><span class="typ">GLDrawable</span><span class="pln"> gld</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">boolean</span><span class="pln"> bln</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">boolean</span><span class="pln"> bln1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />            </span><span class="kwd">throw</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">UnsupportedOperationException</span><span class="pun">(</span><span class="str">"Not supported yet."</span><span class="pun">);</span><span class="pln"><br />        </span><span class="pun">}</span><span class="pln"><br />    </span><span class="pun">}</span><span class="pln"><br /></span>[/prettify]