Java using GUI's mixed with opengl... needs help...urgent....

guys, i need help.... is anyone there have an idea about opengl...? ill attach 4 files that needs to be enhanced or debug for possible errors. to see the canvas... you should have atleast all the needed lib and jar of opengl in your pc.
its urgent, its for our thesis actually....ill be dividing the codes with the use of (" **** ")sign...
* Main.java
* Created on 29 January 2007, 08:12
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong;
* @author welcome
public class Main {
    /** Creates a new instance of Main */
    public Main() {
     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here
        frmMain f = new frmMain();
* frmMain.java
* Created on November 10, 2006, 10:52 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong; // create a floder named longgong and add the class inside
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
* @author all user
public class frmMain extends JFrame implements ActionListener, ChangeListener, ItemListener{
    JPanel pnlWest, pnlEast, pnlCenter, pnlSouth, pnlTitle, pnlSlider, pnlPlayers;
    JSlider slrSpeed;
    JList lstResults;
    String varResults [] = new String[31];
    JLabel lblPlayers, lblTitle;
    JCheckBox lblPlayer1, lblPlayer2, lblPlayer3, lblPlayer4, lblPlayer5, lblPlayer6;
    ImageIcon imgDice1;
    MyCanvas canvas;
    JButton btnStart, btnStop;
    JMenuBar menuBar;
    JMenu menuFile, menuView, menuHelp;
    JMenuItem menuNew, menuExit, menuIn, menuOut, menuHigh, menuPlay, menuAbout;
    boolean isNew = false;
    /** Creates a new instance of frmMain */
    public frmMain() {
        setLayout(new BorderLayout());
        setTitle("Longgong");
        setSize(780,600);
        canvas = new MyCanvas(getSize().width, getSize().height);
        imgDice1 = new ImageIcon("c:\\java\\images\\one.png");
        menuBar = new JMenuBar();
        menuFile = new JMenu("File");
        menuView = new JMenu("View");
        menuHelp = new JMenu("Help");
        menuNew = new JMenuItem ("New Game");
        menuNew.addActionListener(this);
        menuExit = new JMenuItem ("Exit");
        menuExit.addActionListener(this);
        menuIn = new JMenuItem ("Zoom In");
        menuIn.addActionListener(this);
        menuOut = new JMenuItem ("Zoom Out");
        menuOut.addActionListener(this);
        menuHigh = new JMenuItem ("High Score");
        menuPlay = new JMenuItem ("How To Play");
        menuPlay.addActionListener(this);
        menuAbout = new JMenuItem ("About");
        menuAbout.addActionListener(this);
        menuFile.add(menuNew);
        menuFile.add(menuExit);
        menuView.add(menuIn);
        menuView.add(menuOut);
        menuView.add(menuHigh);
        menuHelp.add(menuPlay);
        menuHelp.add(menuAbout);
        menuBar.add(menuFile);
        menuBar.add(menuView);
        menuBar.add(menuHelp);
        setJMenuBar(menuBar);
        varResults[0] = "Dice Results";
        varResults[1] = "1. 3-4-2";
        varResults[2] = "2. 3-1-4";
        varResults[3] = "3. 3-6-5";
        slrSpeed = new JSlider(0, 100, 0);
        slrSpeed.setPaintTicks(true);
        slrSpeed.setMinorTickSpacing(1);
        slrSpeed.setPaintLabels(true);
        slrSpeed.setSnapToTicks(true);
        slrSpeed.addChangeListener(this);
        slrSpeed.setEnabled(false);
        btnStart =  new JButton("Start");
        btnStart.addActionListener(this);
        btnStop =  new JButton("Stop");
        btnStop.addActionListener(this);
        pnlWest = new JPanel();
        pnlEast = new JPanel();
        pnlCenter = new JPanel();
        pnlSouth = new JPanel();
        pnlTitle = new JPanel();
        pnlSlider = new JPanel();       
        pnlPlayers = new JPanel();
        pnlWest.setLayout(new BorderLayout());
        pnlEast.setLayout(new BorderLayout());
        pnlEast.setPreferredSize(new Dimension(100,400));
        pnlCenter.setLayout(new BorderLayout());
        pnlSouth.setLayout(new FlowLayout());
        pnlTitle.setLayout(new FlowLayout());
        pnlSlider.setLayout(new FlowLayout());       
        pnlPlayers.setLayout(new BoxLayout(pnlPlayers,BoxLayout.Y_AXIS));
        pnlPlayers.setPreferredSize(new Dimension(150,400));
        lblPlayers = new JLabel("  Players: Choice (s)");
        lblPlayer1 = new JCheckBox("None");
        lblPlayer1.addItemListener(this);
        lblPlayer2 = new JCheckBox("None");
        lblPlayer2.addItemListener(this);
        lblPlayer3 = new JCheckBox("None");
        lblPlayer3.addItemListener(this);
        lblPlayer4 = new JCheckBox("None");
        lblPlayer4.addItemListener(this);
        lblPlayer5 = new JCheckBox("None");
        lblPlayer5.addItemListener(this);
        lblPlayer6 = new JCheckBox("None");
        lblPlayer6.addItemListener(this);
        lstResults = new JList(varResults);
        pnlPlayers.add(lblPlayers);
        pnlPlayers.add(lblPlayer1);
        pnlPlayers.add(lblPlayer2);
        pnlPlayers.add(lblPlayer3);
        pnlPlayers.add(lblPlayer4);
        pnlPlayers.add(lblPlayer5);
        pnlPlayers.add(lblPlayer6);
        pnlSlider.add(slrSpeed);
        pnlSlider.add(btnStart);
        pnlSlider.add(btnStop);
        pnlEast.add(BorderLayout.CENTER, lstResults);
        pnlCenter.add(BorderLayout.SOUTH, pnlSlider);    
        pnlCenter.add(BorderLayout.CENTER, canvas);    
        lblTitle = new JLabel("LONGGONG DICE GAME SIMULATION");
        pnlTitle.add(lblTitle);
        getContentPane().add(BorderLayout.NORTH,pnlTitle);   
        getContentPane().add(BorderLayout.WEST,pnlPlayers);
        getContentPane().add(BorderLayout.EAST,pnlEast);
        getContentPane().add(BorderLayout.CENTER, pnlCenter);
        getContentPane().add(BorderLayout.SOUTH,pnlSouth);
        setResizable(false);
        canvas.start();
        show();       
    //name change when player is selected
    public void itemStateChanged(ItemEvent e) {
    Object source = e.getItemSelectable();
    int choice;
    if (source == lblPlayer1) {
        if (lblPlayer1.isSelected()) {
            frmChoices fchoices = new frmChoices(lblPlayer1);
    if (source == lblPlayer2) {
        if (lblPlayer2.isSelected()) {
            frmChoices fchoices = new frmChoices(lblPlayer2);
    if (source == lblPlayer3) {
        if (lblPlayer3.isSelected()) {
            frmChoices fchoices = new frmChoices(lblPlayer3);
    if (source == lblPlayer4) {
        if (lblPlayer4.isSelected()) {
            frmChoices fchoices = new frmChoices(lblPlayer4);
    if (source == lblPlayer5) {
        if (lblPlayer5.isSelected()) {
            frmChoices fchoices = new frmChoices(lblPlayer5);
    if (source == lblPlayer6) {
        if (lblPlayer6.isSelected()) {
            frmChoices fchoices = new frmChoices(lblPlayer6);
       // if (e.getStateChange() == ItemEvent.DESELECTED)
        //...make a note of it...
    //slider speed change
    public void stateChanged(ChangeEvent e){      
           canvas.speed(slrSpeed.getValue());
    public void actionPerformed (ActionEvent e){
        if (e.getActionCommand().equals ("Exit")){
            System.exit (0);     
        //connects to frmNew
        if (e.getActionCommand().equals ("New Game")){
            frmNew n = new frmNew(this);   
            lblPlayer1.setText("None");
            lblPlayer2.setText("None");
            lblPlayer3.setText("None");
            lblPlayer4.setText("None");
            lblPlayer5.setText("None");
            lblPlayer6.setText("None");
            isNew = true;
            lblPlayer1.setSelected(false);
            lblPlayer2.setSelected(false);
            lblPlayer3.setSelected(false);
            lblPlayer4.setSelected(false);
            lblPlayer5.setSelected(false);
            lblPlayer6.setSelected(false);
        if (e.getActionCommand().equals ("Start")){
           slrSpeed.setEnabled(true);
           canvas.setRandomDicePosition();
        if (e.getActionCommand().equals ("Stop")){
            slrSpeed.setValue(0);
            slrSpeed.setEnabled(false);
        //ADDED
         if (e.getActionCommand().equals ("New Game")){
           frmNew n = new frmNew(this);           
        if (e.getActionCommand().equals ("Zoom In")){
            canvas.zoomIn();          
        if (e.getActionCommand().equals ("Zoom Out")){
            canvas.zoomOut();          
        if (e.getActionCommand().equals ("How To Play")){
            frmPlay p = new frmPlay();           
        if (e.getActionCommand().equals ("About")){
            frmAbout a = new frmAbout();           
package longgong;
// Java  classes
   import java.awt.*;
   import java.awt.event.*;
   import java.net.URL;
// GL4Java classes
   import gl4java.GLContext;
   import gl4java.awt.GLAnimCanvas;
   import gl4java.utils.textures.*;
   class MyCanvas extends GLAnimCanvas implements KeyListener, MouseListener
     // holds information on which keys are held down.
      boolean[] keys=new boolean[256];
      float     xrot;                    // X Rotation ( NEW )
      float     yrot;                    // Y Rotation ( NEW )
      float     zrot;                    // Z Rotation ( NEW )
      float[] diceRotX = new float[3];
      float[] diceRotY = new float[3];
      float[] diceRotZ = new float[3];
      float[] diceTranX = new float[3];
      float[] diceTranY = new float[3];
      float[] diceTranZ = new float[3];     
      float speedValue;
      Dice[] D;
      float zoom = -15.0f;
      public MyCanvas(int w, int h)
         super(w, h);
         //Registers this canvas to process keyboard events, and Mouse events
         addKeyListener(this);
         addMouseListener(this);  
         setAnimateFps(60); // seemed to be essential in getting any performance
         speedValue=0.0f;
         diceTranX[0] = -2.0f;
         diceTranY[0] = 2.0f;
         diceTranZ[0] = zoom;
         diceTranX[1] = 2.0f;
         diceTranY[1] = 1.0f;
         diceTranZ[1] = zoom;
         diceTranX[2] = 0.0f;
         diceTranY[2] = -2.0f;
         diceTranZ[2] = zoom;
      public void zoomIn(){
          zoom=zoom+1.0f;
       public void zoomOut(){
          zoom=zoom-1.0f;
      public void speed(float s){
        speedValue=s/100;
    /** void reshape(int width, int height) Called after the first paint command.  */  
      public void reshape(int width, int height)
         if(height==0)height=1;
         gl.glViewport(0, 0, width, height);                       // Reset The Current Viewport And Perspective Transformation
         gl.glMatrixMode(GL_PROJECTION);                           // Select The Projection Matrix
         gl.glLoadIdentity();                                      // Reset The Projection Matrix
         glu.gluPerspective(45.0f, width / height, 0.1f, 100.0f);  // Calculate The Aspect Ratio Of The Window
         gl.glMatrixMode(GL_MODELVIEW);                            // Select The Modelview Matrix
         gl.glLoadIdentity();                                      // Reset The ModalView Matrix     
   /** void preInit() Called just BEFORE the GL-Context is created. */  
      public void preInit()
      { doubleBuffer = true; stereoView = false; // buffering but not stereoview
      public void setRandomDicePosition(){
         for (int i=0; i<3; i++){
           D.setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
D[i].getRandomDice();
/** void init() Called just AFTER the GL-Context is created. */
public void init()
//float width = (float)getSize().width;
//float height = (float)getSize().height;
D = new Dice[5];
D[0] = new Dice(this);
D[1] = new Dice(this);
D[2] = new Dice(this);
//initialize dice location
for (int i=0; i<3; i++){
D[i].setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
D[i].getRandomDice();
gl.glEnable(GL_TEXTURE_2D);                              //Enable Texture Mapping ( NEW )
gl.glShadeModel(GL_SMOOTH); //Enables Smooth Color Shading
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //This Will Clear The Background Color To Black
gl.glClearDepth(1.0); //Enables Clearing Of The Depth Buffer
gl.glEnable(GL_DEPTH_TEST); //Enables Depth Testing
gl.glDepthFunc(GL_LEQUAL); //The Type Of Depth Test To Do
gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Really Nice Perspective Calculations
public void DrawBoundaries(){
double x,y;
double radius = 5.0f;
gl.glLoadIdentity();                                             // Reset The View
gl.glTranslatef(0.0f,0.0f,zoom-1.0f);
gl.glRotatef(90.0f,0.0f,0.0f,1.0f);
gl.glColor3f(0.6f,0.3f,0.3f);
gl.glBegin(gl.GL_POLYGON);
// angle is
// x = radius * (cosine of angle)
// y = radius * (sine of angle)
for (double a=0; a<360; a++) {
x = radius * (Math.cos(a));
y = radius * (Math.sin(a));
gl.glVertex3d(x, y, 0.0f);
gl.glEnd();
gl.glColor3f(1.0f,1.0f,1.0f);
public void DrawGLScene()
gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);     // Clear The Screen And The Depth Buffer
DrawBoundaries();
for (int i=0; i<3; i++){
D[i].startDiceMovement();
D[i].setTz(zoom);
D[i].setSpeed(speedValue);
D[i].drawDice();
for (int i=0; i<3; i++){
//start of loop
if(i!=0){    
if (D[0].getMoveLeft()==true){        
if ( (D[0].getTx()>=D[i].getTx()-1.0f) && (D[0].getTx()<=D[i].getTx()) ){
if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
else D[0].setMoveLeft(true);
}else{
if ( (D[0].getTx()-1<=D[i].getTx()) && (D[0].getTx()-1>=D[i].getTx()-1) ){
if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
else D[0].setMoveLeft(true);
if (D[0].getMoveUp()==true){        
if ( (D[0].getTy()>=D[i].getTy()-1.0f) && (D[0].getTy()<=D[i].getTy()) ){
if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
else D[0].setMoveUp(true);
}else{
if ( (D[0].getTy()-1<=D[i].getTy()) && (D[0].getTy()-1>=D[i].getTy()-1) ){
if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
else D[0].setMoveUp(true);
}//end of if i!=0
if(i!=1){    
if (D[1].getMoveLeft()==true){        
if ( (D[1].getTx()>=D[i].getTx()-1.0f) && (D[1].getTx()<=D[i].getTx()) ){
if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
else D[1].setMoveLeft(true);
}else{
if ( (D[1].getTx()-1<=D[i].getTx()) && (D[1].getTx()-1>=D[i].getTx()-1) ){
if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
else D[1].setMoveLeft(true);
if (D[1].getMoveUp()==true){        
if ( (D[1].getTy()>=D[i].getTy()-1.0f) && (D[1].getTy()<=D[i].getTy()) ){
if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
else D[1].setMoveUp(true);
}else{
if ( (D[1].getTy()-1<=D[i].getTy()) && (D[1].getTy()-1>=D[i].getTy()-1) ){
if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
else D[1].setMoveUp(true);
}//end of if i!=1
if(i!=2){    
if (D[2].getMoveLeft()==true){        
if ( (D[2].getTx()>=D[i].getTx()-1.0f) && (D[2].getTx()<=D[i].getTx()) ){
if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
else D[2].setMoveLeft(true);
}else{
if ( (D[2].getTx()-1<=D[i].getTx()) && (D[2].getTx()-1>=D[i].getTx()-1) ){
if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
else D[2].setMoveLeft(true);
if (D[2].getMoveUp()==true){        
if ( (D[2].getTy()>=D[i].getTy()-1.0f) && (D[2].getTy()<=D[i].getTy()) ){
if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
else D[2].setMoveUp(true);
}else{
if ( (D[2].getTy()-1<=D[i].getTy()) && (D[2].getTy()-1>=D[i].getTy()-1) ){
if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
else D[2].setMoveUp(true);
}//end of if i!=2
//end of loop for i
/** void display() Draw to the canvas. */
// Purely a Java thing. Simple calls DrawGLScene once GL is Initialized
public void display()
for(int i=0;i<3;i++){
glj.gljMakeCurrent(); //Ensure GL is initialised correctly
DrawGLScene();
glj.gljSwap(); //Swap buffers
glj.gljFree(); // release GL
// Key Listener events
public void keyTyped(KeyEvent e){
public void keyPressed(KeyEvent e){
switch(e.getKeyCode())
//Kill app
case KeyEvent.VK_ESCAPE:
System.exit(0);
break;
default :
if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
keys[e.getKeyCode()]=true;     
break;
public void keyReleased(KeyEvent e){
if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
keys[e.getKeyCode()]=false;
// mouse listener events
public void mouseEntered( MouseEvent evt )
Component comp = evt.getComponent();
if( comp.equals(this ) )
//requestFocus();
public void mouseExited( MouseEvent evt ){
public void mousePressed( MouseEvent evt ){
public void mouseReleased( MouseEvent evt ){
public void mouseClicked( MouseEvent evt )
Component comp = evt.getComponent();
if( comp.equals(this ) )
requestFocus();
* Dice.java
* Created on 08 February 2007, 22:26
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong;
import java.net.URL;
import gl4java.GLContext;
import gl4java.awt.GLAnimCanvas;
import gl4java.utils.textures.*;
* @author welcome
public class Dice {
      GLAnimCanvas glCanvas ;
      URL codeBase;
      int[]texture1 = new int[1]; //Storage for one texture ( NEW )    
      int[]texture2 = new int[1]; //Storage for one texture ( NEW )    
      int[]texture3 = new int[1]; //Storage for one texture ( NEW )    
      int[]texture4 = new int[1]; //Storage for one texture ( NEW )    
      int[]texture5 = new int[1]; //Storage for one texture ( NEW )    
      int[]texture6 = new int[1]; //Storage for one texture ( NEW )    
      float rx;
      float ry;
      float rz;
      float tx;
      float ty;
      float tz;
      float speed;
      boolean txMoveLeft;
      boolean tyMoveUp;
      boolean tzMoveFront;
    /** Creates a new instance of Dice */
    public Dice(GLAnimCanvas g) {
        glCanvas = g;       
        if(!LoadGLTexture("c:\\java\\images\\one.png",texture1)){
            System.out.println("Failed to load Textures,Bailing!");
            System.exit(0);
        if(!LoadGLTexture("c:\\java\\images\\two.png",texture2)){
            System.out.println("Failed to load Textures,Bailing!");
            System.exit(0);
        if(!LoadGLTexture("c:\\java\\images\\three.png",texture3)){
            System.out.println("Failed to load Textures,Bailing!");
            System.exit(0);
        if(!LoadGLTexture("c:\\java\\images\\four.png",texture4)){
            System.out.println("Failed to load Textures,Bailing!");
            System.exit(0);
        if(!LoadGLTexture("c:\\java\\images\\five.png",texture5)){
            System.out.println("Failed to load Textures,Bailing!");
            System.exit(0);
        if(!LoadGLTexture("c:\\java\\images\\six.png",texture6)){
            System.out.println("Failed to load Textures,Bailing!");
            System.exit(0);
        txMoveLeft = true;
        tyMoveUp = true;
     public boolean inCircleBoundaries(float x, float y, float radius)
        float r;       
        r = (float)Math.sqrt((x*x) + (y*y));
        if (r <= radius)
            return  true;
        else
            return false;
    public void setCoordinates(float corRx,float corRy,float corRz,float corTx,float corTy,float corTz){
        rx = corRx;
        ry = corRy;
        rz = corRz;
        tx = corTx;
        ty = corTy;
        tz = corTz;
    public void getRandomDice(){
        int num = (int)(Math.random() * 6);
        if (num==1){
            rx=0.0f;
            ry=0.0f;
            rz=0.0f;
        else if (num==2){
            rx=90.0f;
            ry=0.0f;
            rz=0.0f;
        else if (num==3){
            rx=0.0f;
            ry=-90.0f;
            rz=0.0f;
        else if (num==4){
            rx=0.0f;
            ry=90.0f;
            rz=0.0f;
        else if (num==5){
            rx=-90.0f;
            ry=0.0f;
            rz=0.0f;
        else{
            rx=180.0f;
            ry=0.0f;
            rz=0.0f;
    public float getTx(){
        return tx+0.5f;
    public float getTy(){
        return ty+0.5f;
    public float getTz(){
        return tz+0.5f;
    public void setTz(float z){
        tz=z;
    public boolean getMoveLeft(){
        return txMoveLeft;
    public boolean getMoveUp(){
        return tyMoveUp;
    public void setMoveLeft(boolean m){
        txMoveLeft = m;
    public void setMoveUp(boolean m){
        tyMoveUp = m;
    public void startDiceMovement(){    
        if (txMoveLeft==true) {
            tx+=speed;           
        else {
            tx-=speed;
        if (tyMoveUp==true) {
            ty+=speed;
        else {
            ty-=speed;
        ry+=(speed*4);
        rx+=(speed*4);
        //rz+=(speed*2);
        //tx+=speed;
        //ty+=speed;
        //tz+=speed;             
     if (inCircleBoundaries(tx,ty,3.5f)==false) {  
        if (tx>=3.0f) txMoveLeft = false;
        if (tx<=-3.0f) txMoveLeft = true;
        if (ty>=3.0f) tyMoveUp = false;
        if (ty<=-3.0f) tyMoveUp = true;
    public void setSpeed(float s){
        speed = s;
     public void drawDice(){        
         glCanvas.gl.glLoadIdentity();                                             // Reset The View
         glCanvas.gl.glTranslatef(tx,ty,tz);
         glCanvas.gl.glRotatef(rx,1.0f,0.0f,0.0f);
         glCanvas.gl.glRotatef(ry,0.0f,1.0f,0.0f);
         glCanvas.gl.glRotatef(rz,0.0f,0.0f,1.0f);
         glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture1[0]);        
         glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
            // Front Face
         glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f,  1.0f);
         glCanvas.gl.glEnd();
         glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture6[0]);
         glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
           // Back Face          
         glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
         glCanvas.gl.glEnd();
         glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture2[0]);
         glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
            // Top Face
         glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f, -1.0f);
         glCanvas.gl.glEnd();
         glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture5[0]);
         glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
            // Bottom Face
         glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f,  1.0f);
         glCanvas.gl.glEnd();
         glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture3[0]);
         glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
            // Right face
         glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f,  1.0f);
         glCanvas.gl.glEnd();
         glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture4[0]);
         glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
            // Left Face
         glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f,  1.0f);
         glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f, -1.0f);
         glCanvas.gl.glEnd();
      public boolean LoadGLTexture(String fileName, int textureNumber[])
         PngTextureLoader texLoader = new PngTextureLoader(glCanvas.gl, glCanvas.glu);
         if(codeBase!=null)  
            texLoader.readTexture(codeBase, fileName);
         else
            texLoader.readTexture(fileName);
         if(texLoader.isOk())
            //Create Texture
            glCanvas.gl.glGenTextures(1, textureNumber);
            glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, textureNumber[0]);
            glCanvas.gl.glTexParameteri(glCanvas.gl.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

ill attach 4 files that needs to be
enhanced or debug for possible errors. i hate to break it to you, but even if you post this for the seventh time, finding and fixing errors in your code remains your task.

Similar Messages

  • Project Server 2013: I am using Project Server Permission Mode and need help with permission assignments?

    Hi 
    Project Server 2013: I am using Project Server Permission Mode and need help with permission assignments?
    How can I change Permissions for the individual users to see specific projects or all projects in project center and to see specific quick launch items?
    For Example: if i have 4 users, A, B, C and D. what i want is:
    User A can see everything and act as a project manager or Admin.
    User B can view all projects in project centre but can change the schedule or resource assignment etc.
    User C can only act as approver of projects and can view all projects in project centre.
    User D can only view specific projects for which permissions are given.
    can i have some expert help in sorting and understanding permission modes... as i was playing with project server mode permissions and can't figure out how to apply the above scenario to set of my user.
    Thanks in Advance
    Cheers
    AJ
    Ajay Kumar

    Hi Ajay,
    Please refer to this link for detailed explanations about PS2013 security model. 
    http://technet.microsoft.com/en-us/library/cc197638(v=office.15).aspx
    Actually, it will take a couple of days to explain in detail the security model that is a fundamental and tricky aspect of every PS implementation. But basically, you NEVER set permissions for a single user. You have groups in which your insert users. Groups
    define "what users can do". Then you associate groups to a corresponding category. Categories define "what user can see". Thus the association of a group with a category will set "what the user can do on the objects he can see". Then, for more advanced security
    level, you can use the RBS that will consist in "branches" in which you'll insert users. Based on those branches, you'll customize categories to fine-tune what user can see (for projects and resources) depending on the RBS branch and level.
    I'd advice you to start "playing" in a test environment with the default categories/groups that might probably cover your need.
    Concerning your 4 users:
    user A : add him to the "administrator" group. Be careful that you're mentionning either project manager or administrator, which are 2 groups/categories with totally different permissions level.
    user B : basically can see everything and change everything? it could be in the project manager group, assuming that there are no project visibility restrictions on the category via the RBS.
    user C : waht do you mean by "approver"? Workflow approvals? Then it will be the portfolio manager group. Task update or timesheet approval? Then it is another long topic: please refer in the documentation to the "status manager" and "timesheet manager"
    concepts. There are not related to the security model. In a few words, the status manager is the owner of the project plan, is defined for each task and approves tasks updates. The timesheet manager is an attribute defined for each resource in its parameters
    and approves resource timesheet.
    user D : you have to define which permission level must be given to this user. Basically it could be a team member that will see only projects he's in the project team. Note that team member cannot interact with the project plan in another way than submitting
    timesheets and/or tasks updates which must be approved.
    Once more, those are large and complex subjects that require a deep dive into your business model and tons of tests in a test environment.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Need help urgently with OS X and Windows 7

    I need help urgently.
    I installed Windows 7 on my macbook pro with OS X Lion. After installing Windows7, I accidently converted the basic volumes to dynamic volumes and now i can't even boot to OS X.
    Please help me how to recover my OS X Lion. If I have to delete Windows and bootcamp partitions, it is OK.
    I just want to get back my OS X bootable.
    Thanks

    thihaoo wrote:
    Sorry
    I can't even see the OS X partition when I hold down the "Option" key.
    I could see OS X and Windows partitions if I hold down Option key before changing the partitions to Dynamic partitions from Basic in Windows 7.
    Now can't see OS X partiton and only see Winodws partition but when I tried to boot onto Windows7 , I got BSOD and macbook pro restart.
    Please help
    The usual reason for the OSX partition to be invisible under these circumstances is that it has been trashed by Windows.
    Do you have a backup?

  • Need help urgently, I upgraded my iPhone 4 with new OS 5, but at the last restore failed. Apple Customer Care helped me to resynch my phone with all that available in Library. I've got all back except my Contact no. Pls help guys, thnx

    Need help urgently, I upgraded my iPhone 4 with new OS 5, but at the last restore failed. Apple Customer Care helped me to resynch my phone with all that available in Library. I've got all back except my Contact no. Pls help guys, thnx Plz guys anyone can help plzz....I've lost all contact and I dont even have any secondary back up also...!!!

    If you've had it for less than a year, then it's still under warranty.  Take it to an Apple store or an authorized service facility.  See http://support.apple.com/kb/HT1434

  • Need help urgent,my iphone is stuck at connect to itunes screen.when i restore with itunes it shows error -1. please help me

    need help urgent, my iphone is stuck at connect to itunes screen, when i restore it using itunes, it shows error -1...may someone help me plz....

    See:
    iOS: Unable to Update or Restore
    http://support.apple.com/kb/ht1808

  • I have lost the use of my extension pannels, and need help recovering the use. I get a message that extensions failed to load. Why?

    I have lost the use of my extension pannels, and need help recovering the use. I get a message that extensions failed to load. Why?

    I've had that before when on a really slow Internet connection.

  • Sound trouble need help urgent please

    Could somebody tell me how i can fix my problem.
    problem: when my curve 8520 is in silence profile en i start typing in a phnoe number i hear nothing,
    but when my phone is in normal profile i hear i beep with every number of the phone number i enter.
    so i want to know how i can stop my bb from making this noise

    My friend it is a fillable form, can i email you the pdf that iam trying to fill out? then would you be able to tell me how to do it please mate?
    I have attached the form, i need to fill in those boxes so that everything is accuratly height + spacing is correct, and to do it fast, thats all im after.
    Date: Sun, 27 Jun 2010 18:31:58 -0600
    From: [email protected]
    To: [email protected]
    Subject: Need Help Urgent Please
    If is a fillable form, just tab to the next field. What we do not understand from you is IF it is a fillable form or not. If it is not, then the 3 options I gave can be used. Placing text is always a problem. You might find it useful to turn on the grid to help in placing your typewriter fields. However, if it is fillable you do not have to create any fields to type in, you just leave the tool as the hand tool and select the predefined fields with the cursor or the tab key and type accordingly. If the field is a checkbox, then you just use the space key to activate it.
    So, are we talking about a fillable form or something that has the appearance of a form, but not fields to fill in. This is what Bernd has been try to find out and you keep suggesting it is fillable as we read what you have said.
    >

  • Username and password- Need help urgently!

    Hi
    1) First of all, i have received an email stating that my account under Removed personal information to comply withCommunity GuidelinesandTerms and Conditions of Use.
    is being banned as there is multiple obsence post. I need to clarify that i have never used my account to post in BBM forum before. Even if i did, is when i need help urgently for my BBM application. Currently i am holding 4 bbms now. Have never came across this issue. Pls check and advise
    2) I urgently need to setup my email accounts. But this time round, when i logged in, they required for my email id and password. And yes my email id is Removed personal information to comply withCommunity GuidelinesandTerms and Conditions of Use. all the while for the past 4 years. I am unable to log in. I tried all kinds of password but unable to log into my mobile settings
    Verfiy Blackberry ID
    This application requires u to verify ur blackberry id to continue.
    blackberry ID username:
    Removed personal information to comply withCommunity GuidelinesandTerms and Conditions of Use.
    password:
    I went to the forget password option, unfortunately as i have never retrieved my password before, i am unable to remember the security question as i did not use it for the past 4 years.
    Pls advise.
    Urgent and thanks

    Hi,
    I have been trying this technique for the past 4 days. It doesnt work no matter how i change the password at the link that u gave me. Even though it's being reset accordingly, i am still unable to log in the password at my mobile. i am 100% sure that i have entered the correct password at my mobile. ( verify blackberry id) . I want to setup new email accounts under "setup" . Upon me clicking " email accounts", it prompt for the one key password. I have never faced this issue before. I am very very sure that my password is correct. Pls advise as i need to add email accounts. Other programs are working fine without any password required being prompt. ie. blackberry world
    This is very very urgent to be resolved. Pls help.

  • I want to buy an in-app purchase but i don`t remember my security questions and i cant access my recovery email either, what can i do? i have 100$ on my account and cant use it because of that problem, please help URGENT

    I want to buy an in-app purchase but i don`t remember my security questions and i cant access my recovery email either, what can i do? i have 100$ on my account and cant use it because of that problem, please help URGENT

    If you have a rescue email address on your account then you can use that - follow steps 1 to 5 half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact Support in your country to get the questions reset : http://support.apple.com/kb/HT5699

  • BB Curve 8900 need help urgently!!!!!

    hey my blackberry 8900 rebooted but now it says "Reload Software:552" and no matter what buttons I press it just won't work, please tel me what to do I really need help urgently!!
    Solved!
    Go to Solution.

    Before you do anything else:  Do a simple reboot on the BlackBerry in this manner: With the BlackBerry device POWERED ON, remove the battery for a minute, and then reinsert the battery to reboot. A reboot in this manner is prescribed for most glitches and operating system errors, and you will lose no data on the device doing this.
    Please let us know if that reboots the device properly or not.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I tried to buy the  WhatsApp app. The card has been charged. but the app wasnt downloaded.i need help Urgently.

    I tried to buy the  WhatsApp app. The card has been charged. but the app wasnt downloaded.i need help Urgently.

    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    To see which iOS version is installed, tap Settings > General > About

  • Using a digi003 mixer with logic

    i just purchase logic the other day and i cant figure out how to use my digi003 mixing board with it. does logic even support the digi003? the guy at sam ash told me that it did.

    Ok - select an audio track in Logic. In it's channel strip, in the Input box, select the first input that Logic says your system sees.
    Click on either the red record enable button, or the yellow input monitor button. Play your source through the mixer - do you get levels in Logic? If not, repeat for whatever other inputs are available in the input menu.
    If none of those pass signal, then you need to look at the routing setup on the Alesis mixer to make sure you are routing signals correctly. Unfortunately I don't know that particular device, but check it's manual for how to route channels to the computer.

  • Using Spry Vertical Navigation with Templates-Need to indicate current page

    Using Spry Vertical Navigation with the Dreamweaver templates.  Using editable attributes etc., the current page mennu item does not seem to be changing.  How do you indicate the. current page.

    Persistent Page Indicator on Site Wide CSS Menus:
    http://alt-web.com/Articles/Persistent-Page-Indicator.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • HT202447 What is Java used for?  What would I need it for?

    What is Java used for? 

    Disable Java in your Browser settings, not JavaScript.
    http://support.apple.com/kb/HT5241?viewlocale=en_US
    http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
    http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets

  • Datasource connection with jboss, need help

    Hi friends,
    I am doing data source connection through Jboss (jboss-4.0.2) with mysql database. I am using java(j2sdk1.4.2_04). I have made all changes given in this link -- http://community.jboss.org/wiki/SetUpAMysqlDatasource
    After making changes I restart jboss properly, but when I am going to attempt to connection through class. it give following error.
    1.ERROR! Shared library ioser12 could not be found.
    Can't find SerialContextProvider
    When a create a diffrent new class, then give me this error.
    2. ERROR! Shared library ioser12 could not be found.
    Cannot get connection: javax.naming.CommunicationException: Can't find SerialContextProvider
    Kindly help me out for this problem.
    Thanks
    Abhishek Jain

    user13428037 wrote:
    ,,, JBoss ... give following error.
    1.ERROR! Shared library ioser12 could not be found.
    Can't find SerialContextProvider
    When a create a diffrent new class, then give me this error.
    2. ERROR! Shared library ioser12 could not be found.
    Cannot get connection: javax.naming.CommunicationException: Can't find SerialContextProviderPlease don't crosspost http://www.javaprogrammingforums.com/jdbc-databases/6353-datsource-connection-mysql-need-help.html#post22533
    The
    ERROR! Shared library ioser12 could not be found.error message has nothing to do with you adding a datasource.
    It would happen even before you made the datasource configuration changes.
    Looks like you added a j2ee.jar to the JBoss classpath.

Maybe you are looking for

  • SAP PORTAL Time-Out Settings / BO iView Reports..?

    We have created BO object-specific iView requests in SAP PORTAL based on Ingo's posting.... SAP BusinessObjects Enterprise & SAP Enterprise Portal - Part 3 of 4 Currently, just posting some small CR4E and Analysis for Office (*Design Studio will be a

  • Sharepoint 2010 Foundation administrator permission gone

    Hi all experts; today, we found that the administrator privilege  on Team Site Owners suddenly gone.  All administrators under this group is no longer to manage the Sharepoint site and the users cannot add and edit any new or existing files. It affec

  • BPEL FTP Adapter - tutorial/sample?

    Hi, Is there a sample or tutorial available for the BPEL FTP Adapter for v10.1.2.0? Please let me know. Thanks N

  • Help me in Installing Solaris Express, Developer Edition  X 86

    Hi, Help me in installing Solaris Express, Developer Edition When i am trying to install Solaris, system hangs and the moniter is switcher off when the system goes in GUI mode. i have intel 945GTP mother board with as on board Intel Graphics Media Ac

  • NullPointerException: when call "drawImage" function?

    hello all: I met a java.lang.NullPointerException when I try to call drawImage in my program. My program structure: 1>JFrame / JPanel / ImagePane(which extends JComponent) a object of class ImagePane stays on top of a object of JPanel which stays on