|
Hi,
I'm also currently working on a very similiar program.
Don Heyse wrote:
> It's pretty neat, but it chews up lots of memory. I think j3d must
> be saving every single triangle as an oobject. I watched in the win2000
Yes because of the way .DAT files are made, the most straight forward
way of representing them in J3D is 1 triangle or quad -> 1 Object.
J3D however does tremendously better on both speed and time if
the triangles and quads are arranged in strips. Then each Strip
becomes one object.
I'm not sure how he wrote it up and wether or not he made much use of
strips (I haven't read throught the sources yet,) but in my experience
J3D makes very good use of the underlying library (OpenGL or DirectX)
and can get very good performance.
While there is a utility function that will
try to combine triangles and quads into strips and fans, I haven't
had much luck using it yet. I'm currently trying to write up something
that will be able to 'stripify' .DAT files on the fly, but I'm not
getting much time to work on it.
I'm curious if any of you OpenGL/LDraw guys do much in your code
to generate strips from the DAT files to improve performance? I think
I have most of the available C/C++ code, but I haven't looked through
much of it yet. I know OpenGL can perform better if the data is in
strips, Have you found a need to do aything like that yet?
An Idea I've had recently was a possible extension to the DAT format
for strips. Maybe some thing like
0 STRIP Begin Triangle
3 ...
3 ...
3 ...
0 STRIP End
But I've been putting off suggesting it, because I'm still hopeful
to find an algorithm that can build the strips on the fly from the
data already in the DAT file. who knows.
> most games. They generate detail with textures instead. We tend to
> save lots of memory in C/C++ viewers by only creating each part once
> in memory and then keeping pointers to it, instead of making a copy
> for each occurance of the same brick. I think that's harder to do
> in Java, but perhaps you could manage it with a collection of parts
> or a hash table.
I found it easy to do just what you describe. The J3D Scenegraph allows
it's 'Shape3D' nodes to share 'Geometry'. By using a HashTable of the
file already read in, it's relatively easy to attach the same geometry
over and over in the scene. This saves *alot* of memory (and makes
processing the files alot faster also.)
> Of course I haven't really look at the code yet so
> you could be doing that already.
Me too. I hope to go over it this weekend.
> Have you looked into any of the opengl bindings for java? GL4Java looks
> pretty cool and claims to have Mac support, which would make James very
> happy.
I haven't looked at GL4Java myself, but I've read many discussion on
the java3d-interest mailing list about it's pro's and con's. So far I've
been very impressed with J3D and I haven't really had to look into
anything else.
-Kyle
--
_
-------------------------------ooO( )Ooo-------------------------------
Kyle J. McDonald (o o) Systems Support Engineer
Sun Microsystems Inc. |||||
High End Server Engineering Kyle.McDonald@Sun.COM
1 Network Drive BURL03-403 \\\// voice: (781) 442-2184
Burlington, MA 01803 (o o) fax: (781) 442-1646
-------------------------------ooO(_)Ooo-------------------------------
|
|
Message has 2 Replies: | | Re: JAVA - Viewer for dat-Files
|
| "Kyle McDonald" <kmcdonald@bigfoot.com> schrieb im Newsbeitrag news:3C519D02.204090...oot.com... Hi, for how I'm doing the internal creating: I did a depth search with hashing the files, create two shapes for all lines, quads, triangles, each (...) (23 years ago, 26-Jan-02, to lugnet.cad, lugnet.cad.dat.parts)
|
Message is in Reply To:
| | Re: JAVA - Viewer for dat-Files
|
| (...) I'll have to try it again with j3d 1.2. I did manage to register and download j3d 1.3, and directx8 and get it working with this command. java -classpath viewer.jar de/onlinehome/broich...pplet/Show PATH=c:\ldraw FILE=%1 It's pretty neat, but (...) (23 years ago, 25-Jan-02, to lugnet.cad, lugnet.cad.dat.parts)
|
20 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|