Java-Gaming.org    
Featured games (86)
games approved by the League of Dukes
Games in Showcase (437)
games submitted by our members
Games in WIP (466)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java Sound & OpenAL / Installing JOAL with netbeans IDE on: 2008-11-23 10:21:26
Hi all,

quick question. How do i go about installing joal libraries to use them in my project in netbeans under windows ?

Did a lot of googling but could not find any definite answer.

thanks
-ankit
2  Game Development / Newbie & Debugging Questions / Re: OpenGl transformation question newbie on: 2008-11-23 10:19:11
lhkbob,

thank you for the advice ... i think i understand it now Cheesy

-ankit
3  Game Development / Newbie & Debugging Questions / Re: OpenGl transformation question newbie on: 2008-11-18 06:39:27
hmm .. .i am not sure if i follow ur advice completely.

so i use init() for 1-time stuff. now you said that in the keylistener i should set a boolean to recompute the projection matrix .. assuming i do that , how would the display() function of opengl get called ? wont i need to explicitly call it from my keylistener ?

thanks
-ankit
4  Game Development / Newbie & Debugging Questions / Re: OpenGl transformation question newbie on: 2008-11-18 01:00:54
lhkbob,

thank you so much ! fixing the camera project did the trick  Grin

have another noob question.

i added code so that every time the user presses the right key i change the camera rotate angle to rotate the final projection. it works fine except that right now what i do is (pseudocode)

1  
2  
3  
4  
5  
6  
7  
8  
9  
void keypressed(....)
{
       if key(==right key)
       {
               angle+=2.0f;
               init();
               display();
        }
}


so i am calling the display() and init() every time => redrawing the whole scene. i am wondering since opengl is a state machine there should be a way to just recompute the projection according to the new angle instead of drawing the whole thing again ... any ideas how would i do that ?

thanks
-ankit
5  Game Development / Newbie & Debugging Questions / Re: OpenGl transformation question newbie on: 2008-11-17 01:22:05
Not exactly sure what you mean by -ve, can you elaborate?

the code is supposed to draw all the axes between the limits [-0.5,0.5] however if you look at the attached picture
of the output all i see is the positive half of the axis lines.

-ankit
6  Game Development / Newbie & Debugging Questions / Re: OpenGl transformation question newbie on: 2008-11-16 08:57:23
ok ..makes sense .. so i modified my code and now i can see the axis with the desired view however there is a small problem in the code

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
 final GL gl = drawable.getGL();
        final GLU glu = new GLU();
        gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();
        gl.glTranslatef(0.0f, 0.0f, -1.0f);
        gl.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
        gl.glRotatef(45.0f, 0.0f, 1.0f, 0.0f);
        //gl.glRotatef(xy_angle0 , xz_angle, xy_angle, xz_angle);
       
 

        gl.glColor3f(0.0f, 0.0f, 0.0f);
       
        //gl.glRotatef(xz_angle, 0.0f, 0.0f, 1.0f);
       gl.glBegin(GL.GL_LINES);
       
           
            //x axis = green
           gl.glColor3f(0.0f, 1.0f, 0.0f);
            gl.glVertex3f( -1.5f, 0.0f, 0.0f );
            gl.glVertex3f( 1.5f, 0.0f, 0.0f );
           
            //y axis = red
           gl.glColor3f(1.0f, 0.0f, 0.0f);
            gl.glVertex3f( 0.0f, -1.5f, 0.0f );
            gl.glVertex3f( 0.0f, 1.5f, 0.0f );
           
            //z axis = blue
           gl.glColor3f(0.0f, 0.0f, 1.0f);
            gl.glVertex3f( 0.0f, 0.0f, -1.5f );
            gl.glVertex3f( 0.0f, 0.0f, 1.5f );
           
                     
           
        gl.glEnd();
        gl.glFlush();


the output that i get is :



my question .. why cant i see the -ve part of the axis ?

thanks again
-ankit
7  Game Development / Newbie & Debugging Questions / OpenGl transformation question newbie on: 2008-11-15 23:13:05
Hi all,

i am a complete newbie to opengl taking a computer graphics course this semester. we just did transformations so i am playing around with some code to make sure i understand them. however there seems to be some basic flaw in my understanding as i always get output different that what i predicted.

I have posted a sample code below and hoping someone would be kind enough to walk me through it to point what i am not getting right.

the code below is supposed to draw x,y and z axis with the viewpoint situated at (1,1,1) so that i can see all the axis.

what i want to see is all 3 axes in something like

              *         *
              *       *
              *     *
              *   *
*******************
            **
         *   *
       *     *
    *        *


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
gl.glClear(GL.GL_COLOR_BUFFER_BIT|gl.GL_DEPTH_BUFFER_BIT);   //clear gl buffers
gl.glMatrixMode(GL.GL_MODELVIEW); //set the current matrix as modelview
gl.glLoadIdentity(); //load identity matrix => locate viewpoint at (0,0,0)

gl.glClearColor(1.0f,1.0f,1.0f,0); //clear window with white
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gl.glColor3f(0.0f, 0.0f, 0.0f); //set drawing color as black
       
gl.glBegin(GL.GL_LINES);  //draw all three axis within -0.5 to +0.5 with viewer at (0,0,0). this when rendered will show a
     gl.glVertex3f( -0.5f, 0.0f, 0.0f ); // a plus sign since z axis would be 'hidden'
     gl.glVertex3f( 0.5f, 0.0f, 0.0f );
         
     gl.glVertex3f( 0.0f, -0.5f, 0.0f );
     gl.glVertex3f( 0.0f, 0.5f, 0.0f );
           
     gl.glVertex3f( 0.0f, 0.0f, -0.5f );
     gl.glVertex3f( 0.0f, 0.0f, 0.5f );
           
gl.glEnd();
gl.glTranslatef(1.0f, 1.0f, 1.0f); //finally move the viewer to (1,1,1) to get the desired view

when i run this all i see is half a part of of the plus sign drawn at the top right corner of the gl canvas.

thank you for all the help
-ankit

Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (72 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (79 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (80 views)
2014-04-14 15:48:38

tom_mai78101 (104 views)
2014-04-10 04:04:31

BurntPizza (164 views)
2014-04-08 23:06:04

tom_mai78101 (260 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!