Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / March 2007

Tip: Looking for answers? Try searching our database.

IndexedTriangleStripArray + NormalsGenerator (lighting problems)

Thread view: 
Miss Elaine Eos - 23 Mar 2007 05:22 GMT
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!

Signature

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.

Miss Elaine Eos - 23 Mar 2007 07:35 GMT
> 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).

Signature

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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.