Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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: Inward-pointing Normal Vector? on: 2005-11-19 16:13:03
Works great for me!  Thank you soooo much!   Cheesy
2  Java Game APIs & Engines / JOGL Development / Re: Inward-pointing Normal Vector? on: 2005-11-18 15:13:50
The problem is that you're not initializing the modelview and projection matrices, which I believe both default to the identity matrices. In effect this means that the camera is inside the cube. I've attached a modified version of your test case (which works with the JOGL nightly build) which shows this. See the initialization code in init().


Ken,

I am not seeing your attachment. Could you post it again? Thanks.
3  Java Game APIs & Engines / JOGL Development / Re: Inward-pointing Normal Vector? on: 2005-11-18 04:42:29
Thank you for your help.  I am attaching my code with this post (it's very short, just enough code to display a unit cube).  Look at the method drawUnitCube for 2 sets of quads method calls which have opposite normals. If you run the program, with the outward-pointing normal, the cube is rendered in black; while with the inward-pointing normal, the cube is displayed in the purple color that is set through the material properties. 

4  Java Game APIs & Engines / JOGL Development / Inward-pointing Normal Vector? on: 2005-11-18 02:50:57
Hi,

I know this is weird. I have some problem with the direction of the normal. I know it should be pointing outward; however, when I try to disply a 3D unit cube made of 6 polygons, for each polygon, I have to set the normal to point toward the inside of the cube to get the proper color. Otherwise, if I use the regular outward-pointing normals, everything is black. I am assuming the x-y-z coordinate is a right-hand coordinate system, with positive x point to the right hand side of the screen, positive y point upward and positive z pointing out the screen; also, I am specifying the vertices in a counter clockwise order if looking from the outside.

I am using JOGL. And here are what I did:

1. Enable depth test;
2. Enable lighting;
3. Enable light0;
4. Set light properties (ambient, etc);
5. Set the material properties;
6. Enable GL_NORMALIZE;

I didn't touch either the projection matrix or the modalview matrix.

Any one has any idea how this could be?

Thank you,
wt
5  Java Game APIs & Engines / Java Sound & OpenAL / Inward-pointing Normal Vector? on: 2005-11-18 02:49:32
 Hi,

I know this is weird. I have some problem with the direction of the normal. I know it should be pointing outward; however, when I try to disply a 3D unit cube made of 6 polygons, for each polygon, I have to set the normal to point toward the inside of the cube to get the proper color. Otherwise, if I use the regular outward-pointing normals, everything is black. I am assuming the x-y-z coordinate is a right-hand coordinate system, with positive x point to the right hand side of the screen, positive y point upward and positive z pointing out the screen; also, I am specifying the vertices in a counter clockwise order if looking from the outside.

I am using JOGL. And here are what I did:

1. Enable depth test;
2. Enable lighting;
3. Enable light0;
4. Set light properties (ambient, etc);
5. Set the material properties;
6. Enable GL_NORMALIZE;

I didn't touch either the projection matrix or the modalview matrix.

Any one has any idea how this could be?

Thank you,
wt
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (48 views)
2014-08-09 21:09:32
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!