AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IndexedTriangleStripArray + NormalsGenerator (lighting probl

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
Miss Elaine Eos
Guest





PostPosted: Fri Mar 23, 2007 7:10 am    Post subject: IndexedTriangleStripArray + NormalsGenerator (lighting probl Reply with quote



Short vsn:

I can't get my lighting to "turn on" WRT to my IndexedTriangleStripArray
(a "mesh" style terrain) and NormalsGenerator.

Code snippet:

IndexedTriangleStripArray terrain =
new IndexedTriangleStripArray (vCount,
IndexedTriangleStripArray.COORDINATES,
iCount,
siCounts
);
// Set up coordinates
[snip]
// set up indecies
[snip]

GeometryInfo gi = new GeometryInfo (terrain);
NormalGenerator ng = new NormalGenerator();
ng.generateNormals (gi);

gi.recomputeIndices();

I've verified that lighting is on by placing a few spheres around the
terrain, and they light correctly. In addition, the terrain displays
correctly and, in fact, even textures nicely (different bit of code.)

Btw, for lighting-testing, I'm turning off textures, as that seems to
interfere with lighting on my test-spheres. (Different question :)

Any hints?

Thanks!

--
Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.
Back to top
Miss Elaine Eos
Guest





PostPosted: Fri Mar 23, 2007 7:10 am    Post subject: Re: IndexedTriangleStripArray + NormalsGenerator (lighting p Reply with quote



In article <Misc-2FC69A.21232922032007 (AT) newsclstr02 (DOT) news.prodigy.com>,
Miss Elaine Eos <Misc@your-pants.PlayNaked.com> wrote:

Quote:
Short vsn:

I can't get my lighting to "turn on" WRT to my IndexedTriangleStripArray
(a "mesh" style terrain) and NormalsGenerator.

Code snippet:

Snip. Nevermind, I think I got it. For the 2nd time this week, the
secret seems to be to flail for a while, then ask. Less than an hour
after hitting send, the answer appears! :D

After I get my code cleaned up a bit, I'll post it as an example to
other n00bs with similar problems.

It had to do with getting the material & textureMode right (MODULATE).

--
Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.