Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (499)
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  
  Newbie needs some help  (Read 692 times)
0 Members and 1 Guest are viewing this topic.
Offline frdfsnlght

Senior Newbie




Trying to understand


« Posted 2004-03-19 03:22:30 »

I'm tearing my hair out with this one. I've been programming Java for about 7 years, and before that I was doing low level 3D stuff (hand-coding line drawing, polygon filling, and transforms in assembly), so I have something of a background in 3D, just not Java3D.

I've done various searches here and on Google, but I can't find any remedy.

I've been working on the a tutorial (http://www.j3d.org/tutorials/raw_j3d/index.html) and I've gotten to the end of chapter one where, supposedly, my program should produce a display with a square. I can't for the life of me figure out why it isn't displaying. All I get is a black window, no square.

I hate posting a pile of code and asking other people to help me, but I fear I have no choice this time. I'm totally stumped.

I've zipped up my code, complete with ant build script and batch file to start to app. I've posted it on my server: http://www.bennedum.org/files/Plasma3D.zip

Could someone please take a look and tell me what I'm missing? Please?

-Tab
Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #1 - Posted 2004-03-19 16:23:56 »

After getting some sleep and calming down a bit, I realized I left out some pertinent info from my previous post.

First of all, there's only 4 source files in the download: Plasma3d.java implements main, Universe.java implements the VirtualUniverse, Camera.java implements the view, and World.java implements the geometry. Together, the files implement a minimal 3d setup without using any of the utility classes in java3d. When I use the SimpleUniverse class from the utilities in other apps, I can get things working, but I don't want to use SimpleUniverse because I need more control over the view (when I get a bit further with my app).

I can run various demos from the java3d package successfully, so I know java3d is essentially working on my setup (which is java 1.4.1_01 and java3d 1.3.1 on WinXP Pro SP1).

Given the info here, I'm led to believe the problem is in the view related class (Camera.java) and not the geometry class (World.java). However, since I don't know what's wrong, who am I to judge?

I've tried fiddling with the camera location and geometry location, thinking maybe I wasn't seeing anything because it wasn't in view. I've also tried adding some ambient lighting, thinking I didn't have enough light. None of these things worked, which again leads me to believe there's something wrong in Camera.java.

I'm still stuck on this. Any help would be appreciated. Please? I can post the code directly to the forum if requested.

-Tab
Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #2 - Posted 2004-03-20 17:41:36 »

I solved the problem. If I had the author of the tutorial in front of me now, I'd strangle him. It will always be a mystery to me why some authors don't test the code they publish.

The problem was the geometry all along. The 4 coords used to define the square were defined in the wrong order so the geometry was being backface culled. Reverse the order and the square appears.

What irks me most is that the author made a point of mentioning the order of the points to prevent just this problem. In a later section of the tutorial, he reveals that j3d uses the right-hand-rule for culling. His orginal example was based on the lef-hand-rule.

I'll try to drop the author a note so he can correct the tutorial.

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

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-03-23 20:29:16 »

hehe, I hear that. The Java3D API Jump Start book is riddled with errors in the examples too.

Will.

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (44 views)
2014-04-15 18:08:23

BurntPizza (40 views)
2014-04-15 03:46:01

UprightPath (56 views)
2014-04-14 17:39:50

UprightPath (38 views)
2014-04-14 17:35:47

Porlus (54 views)
2014-04-14 15:48:38

tom_mai78101 (77 views)
2014-04-10 04:04:31

BurntPizza (136 views)
2014-04-08 23:06:04

tom_mai78101 (236 views)
2014-04-05 13:34:39

trollwarrior1 (197 views)
2014-04-04 12:06:45

CJLetsGame (205 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!