Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Geometry and Light  (Read 1616 times)
0 Members and 1 Guest are viewing this topic.
Offline adenthar

Senior Newbie

Java games rock!

« Posted 2004-07-16 15:08:46 »

Hello everybody,

I want to make some code to create a sphere geometry like the TestUtils.createSphere() but with uvMapping and some more options and to learn more about geometry Smiley.
I made it but i've got some problem with light.

With TestUtils.createSphere()  the sphere is lighted correctly (part of the sphere shadowed)

With the same code but with my createSphere the sphere is :
- not lighted when the light is on negative Z axis
- completely lighted with no shadows on it when the light is on positive Z axis

i don't understand the problem with my geometry. With culling on; the normals seems good. What other parameters must be set for the geometry to  be correctly lighted ?
(for the moment i only make the coord points (in correct order for the normal but i don't explicity make the normal) and i put the texture Coords)

Thanks for help,

Offline aschwalb

Senior Newbie

Java games rock!

« Reply #1 - Posted 2004-07-17 08:12:32 »

Hello Adenthar

Have you set a material on your sphere?
Set 'shininess' to 0.0f, so your sphere is not
complete highlighted.

Bye Adi
Offline adenthar

Senior Newbie

Java games rock!

« Reply #2 - Posted 2004-07-17 08:22:37 »

hello aschwalb,

alas, it's not that : i take exactly the same material, the same position and the same light : using the TestUtils.createSphere geometry it works, but with my sphere geometry it has this amazing behavior...

the geometry is missing something i think, but i don't know what...


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline aschwalb

Senior Newbie

Java games rock!

« Reply #3 - Posted 2004-07-19 18:33:29 »

Hello Adenthar

I use my own primitives. Sphere with trianglegeometry
or sphere with quadarraygeometry.
I have no idea, how i can integrate an image here,
so i can show you an example.
Also you must do a correct setting for Textureattributes,
Light and Material (for your Appearance).

int features = ...............;

final int FLAGS               = GeometryArray.COORDINATES | (features&GeometryArray.NORMALS)
| (features&GeometryArray.TEXTURE_COORDINATE_2);
TriangleArray geom      = new TriangleArray( maxPoints, FLAGS );
geom.setCoordinates(0, vertex);
if ( (FLAGS&GeometryArray.NORMALS)!=0 )
geom.setNormals( 0, vertex );

Then all works fine in Xith.

Bye Adi

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

IanParcs (54 views)
2016-04-18 14:18:53

KaiHH (50 views)
2016-04-18 08:35:41

KaiHH (80 views)
2016-04-15 12:43:58

theagentd (83 views)
2016-04-14 02:16:17

theagentd (98 views)
2016-04-14 02:15:43

IanParcs (121 views)
2016-04-12 03:51:16

IanParcs (52 views)
2016-04-12 03:50:03

IanParcs (48 views)
2016-04-12 03:49:54

IanParcs (46 views)
2016-04-12 03:49:52

IanParcs (55 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 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‑
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!