Archived

This topic is now archived and is closed to further replies.

Lubb

[java] Objects of Objects

Recommended Posts

So I''m imagining I''ll write a raytracer/caster/3-D drafting program in Java, because if I used C++ or VB it wouldn''t be very difficult. SO over time, at a casual pace, I am figuring the layout of it all. I want to use a group as the entire scene to be rendered, and I want to be able to have solid-models as well as (sub) groups in groups. .... In C++ or VB I''d have just used a variable list to hold objects with next and last "pointers" for each. This would seem to be possible in JAva of course, but I am wondering if there is some specific way in Java to do this? I can search Google, but don''t know the term to look for...? ~

Share this post


Link to post
Share on other sites
Java actually has something a lot more powerful than STL when it comes to handling hierarchical object structures for 3D graphics (scenegraphs). It is called Java3D.

I do not understand why you would use a linked list in C++ though when it seems like you need a tree structure (since you mention groups and subgroups).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can implement your linked list/tree in java more easily than in C scince every object in java is always passed by reference (like a pointer) and scince all objects are inplicitly decended from class Object. so:

private Object nextObject;
private Object prevObject;

Share this post


Link to post
Share on other sites