Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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 / JOGL Development / Re: Which OpenGL Book To Get? on: 2010-02-28 12:33:04
All good...
I can't say which is better  Smiley
2  Java Game APIs & Engines / JOGL Development / what's your favorite site for JOGL & OpenGL? on: 2010-02-15 06:06:10
Hi javagaming jogl users Cheesy

Every single day I visit here, java-gaming.org, read new topics and search QnA.

May I inquire valued web sites you visit often for getting information about
JOGL & OpenGL such as NeHe, LightHouse, OpenGL and so on?

Thank you
3  Java Game APIs & Engines / JOGL Development / Re: Will no one use fixed functions in the future? on: 2010-02-10 03:12:58
So, do you think that the shader will supersede the fixed functions soon(in 4 years).

If so it might be better to learn and use the shader (not fixed function)?
4  Java Game APIs & Engines / JOGL Development / Will no one use fixed functions in the future? on: 2010-02-09 07:45:24
Hi.

I heard that whole fixed function pipe line is removed since OpenGL3.1
I have a few questions about that news.

Huh Does this mean that most people don't use the fixed functions but instead they prefer the shading?
Or both of OpenGL 3.x and OpenGL 2.x will be steadily maintained for being used in the different domain?


Huh If the graphics driver supports ≥ Opengl 3.1, programs written in fixed functions can't be executed?

Thank you.

Junyeong
5  Java Game APIs & Engines / JOGL Development / Re: light opposite side on: 2010-02-03 09:17:24
Ah ha

That's the point causing the problem.

Thank all answerers  Cool
6  Java Game APIs & Engines / JOGL Development / Re: light opposite side on: 2010-02-02 05:06:03
I think that the problem might come from the method which I use for drawing a sphere.
Because "glutSolidSphere()" works fine with the light but "drawSphere()" does not...

Would you try this code and let me know what the problem is?

The method "drawSphere()" draws a sphere of which radius is 1 and centered at the origin. And you can change the number of subdivision to alter the variable "depth".

Thank you.  Smiley

The code for drawing sphere is as follows.
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  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
// the author of this code: Jim X. Chen

    private final float sVdata[][] = { {1.0f, 0.0f, 0.0f}
                   , {0.0f, 1.0f, 0.0f}
                   , {0.0f, 0.0f, 1.0f}
                   , {-1.0f, 0.0f, 0.0f}
                   , {0.0f, -1.0f, 0.0f}
                   , {0.0f, 0.0f, -1.0f}
    };
    private int depth = 4;

    public void drawSphere() {
   subdivideSphere(sVdata[0], sVdata[1], sVdata[2], depth);
   subdivideSphere(sVdata[0], sVdata[2], sVdata[4], depth);
   subdivideSphere(sVdata[0], sVdata[4], sVdata[5], depth);
   subdivideSphere(sVdata[0], sVdata[5], sVdata[1], depth);

   subdivideSphere(sVdata[3], sVdata[1], sVdata[5], depth);
   subdivideSphere(sVdata[3], sVdata[5], sVdata[4], depth);
   subdivideSphere(sVdata[3], sVdata[4], sVdata[2], depth);
   subdivideSphere(sVdata[3], sVdata[2], sVdata[1], depth);
    }


    private void subdivideSphere(float v1[], float v2[], float v3[], long depth) {
   float v12[] = new float[3];
   float v23[] = new float[3];
   float v31[] = new float[3];
   int i;

   if (depth==0) {
       gl.glColor3f(v1[0]*v1[0], v2[1]*v2[1], v3[2]*v3[2]);
       drawtriangle(v1, v2, v3);
       return;
   }
   for (i = 0; i<3; i++) {
       v12[i] = v1[i]+v2[i];
       v23[i] = v2[i]+v3[i];
       v31[i] = v3[i]+v1[i];
   }
   normalize(v12);
   normalize(v23);
   normalize(v31);
   subdivideSphere(v1, v12, v31, depth-1);
   subdivideSphere(v2, v23, v12, depth-1);
   subdivideSphere(v3, v31, v23, depth-1);
   subdivideSphere(v12, v23, v31, depth-1);
    }

    // normalize a 3D vector
   public void normalize(float vector[]) {
   float d = (float) Math.sqrt(vector[0] * vector[0] + vector[1]
                * vector[1] + vector[2] * vector[2]);

   if (d == 0) {
       System.out.println("0 length vector: normalize().");
       return;
   }
   vector[0] /= d;
   vector[1] /= d;
   vector[2] /= d;
    }

    public void drawtriangle(float[] v1, float[] v2, float[] v3) {
   gl.glBegin(GL2.GL_TRIANGLES);
   gl.glVertex3fv(v1, 0);
   gl.glVertex3fv(v2, 0);
   gl.glVertex3fv(v3, 0);
   gl.glEnd();
    }
7  Java Game APIs & Engines / JOGL Development / Re: light opposite side on: 2010-02-01 16:06:10
Thank you for your response  Smiley

I tried your suggestion that applying
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);

I notice that the SPECULAR and DIFFUSE light doesn't apply to back face.
Only AMBIENT does.

For example, I tried this for another source code.
I set the same material properties to FRONT_AND_BACK face.

I expected that the both faces turns white.

As expected, the front face turns white.
However the back face turns pure red.  Huh
Why the back face uses the AMBIENT property only?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
   gl.glLightModeli(GL2.GL_LIGHT_MODEL_TWO_SIDE,GL2.GL_TRUE);
   gl.glLightModeli(GL2.GL_LIGHT_MODEL_LOCAL_VIEWER, GL2.GL_TRUE);
   gl.glLightModelfv(GL2.GL_LIGHT_MODEL_AMBIENT, new float[] {0,0,0,0}, 0);
   gl.glLightModeli(GL2.GL_LIGHT_MODEL_COLOR_CONTROL, GL2.GL_SEPARATE_SPECULAR_COLOR);

   gl.glEnable(GL2.GL_LIGHT1);
   gl.glLightfv(GL2.GL_LIGHT1, GL2.GL_POSITION, new float[] {0,0,1,0}, 0);
   gl.glLightfv(GL2.GL_LIGHT1, GL2.GL_AMBIENT, new float[] {1.0f,1.0f,1.0f,1.0f}, 0);
   gl.glLightfv(GL2.GL_LIGHT1, GL2.GL_DIFFUSE, new float[] {1.0f,1.0f,1.0f,1}, 0);
   gl.glLightfv(GL2.GL_LIGHT1, GL2.GL_SPECULAR, new float[] {1,1,1,1}, 0);

   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_EMISSION, new float[] {0,0,0,0}, 0);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_AMBIENT,
new float[] {1,0,0,0},
0);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE, new float[] {1,1,1,1}, 0);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_SPECULAR, new float[] {1,1,1,1}, 0);
   gl.glMaterialf(GL2.GL_FRONT_AND_BACK, GL2.GL_SHININESS, 25.0f);
8  Java Game APIs & Engines / JOGL Development / light opposite side on: 2010-01-31 15:04:04
Hi, JOGL users.

I write a jogl program which draws 2 spheres, a big and a small one.

Assume that the bigger sphere is the Earth
and the smaller one revolves around the Earth.

The smaller sphere is drawn at the very location
where a local-light-source places.

But I have a problem.

Not only the side which faces the light-source
but also the opposite side which doesn't face the light source are lit up.

Why the both side lit up? And how not to light the oppsosite side of the sphere?


I feel that my explanation is poor  Lips Sealed

I hope that the attached picture helps you recognize my problem.

Thanks.
9  Games Center / JGO Comp 2009 / Re: Cat On A Wire on: 2010-01-31 05:28:12
The cat is cute! Cheesy
10  Java Game APIs & Engines / JOGL Development / Re: How to figure out which surface I'm clicking? on: 2010-01-24 15:40:14
Thank you guys for all advices.

Happy JOGLing ~~ Cheesy
11  Java Game APIs & Engines / JOGL Development / How to figure out which surface I'm clicking? on: 2010-01-20 02:24:11
Hi, JOGL & OpenGL users.

Assume that there's a cube and each of the faces has a number
like a dice.

The cube rotates around arbitrary axis and degree.

So far, it's fine.

But I don't know what to do next step.

The next step is implementing this: when a user clicks a face of the cube,
the application recognizes what face is clicked and notifies a user what number
is choosed.

Any advice is welcomed.  Smiley
Thank you.

sincerely,
Junyeong
12  Java Game APIs & Engines / JOGL Development / Re: How to: Getting started with JOGL on: 2010-01-19 15:54:12
you can download it from here.  Smiley
http://download.java.net/media/jogl/builds/archive/
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.

Pippogeek (40 views)
2014-09-24 16:13:29

Pippogeek (31 views)
2014-09-24 16:12:22

Pippogeek (21 views)
2014-09-24 16:12:06

Grunnt (47 views)
2014-09-23 14:38:19

radar3301 (29 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (44 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06

BurntPizza (55 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!