File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes 3d objects in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "3d objects in java" Watch "3d objects in java" New topic

3d objects in java

david li

Joined: Jun 26, 2008
Posts: 2
I'm trying to write a program to mimic a 3d architectural representation of a room in java (entities are: windows, walls, ceiling, floor; no furniture or anything inside). Then I will take some input parameters and optimize the spacing of the windows on the building.

I originally made the drawing in google sketchup, exported it as xml, parsed the xml into java classes, so now I java classes (wall, window, etc) containing coordinates for all the vertices of each entity. What I did before was hackish, but adding more functionality might be messy so I want to use existing libraries such as Point and Rectangle that have methods like setLocation, distance.

Are there any java libraries that support 3d geometries? The java.awt.Rectangle and java.awt.Point classes only support 2d shapes. The library should support methods like setLocation, move, etc because I will have to rearrange the windows on each wall after the optimization.

Let me know if my explanation is unclear.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63839

"calmze", please check your private messages for an important administrative matter.

[Asking smart questions] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

You'll need to look at libraries like:


GenRocket - Experts at Building Test Data
david li

Joined: Jun 26, 2008
Posts: 2
More specifically, I would like 3d rectangle and 3d point classes that support all the operations of java.awt.Rectangle and java.awt.Point (which is only 2d). I don't necessarily have to draw anything, just perform the optimization and get updated objects. Eventually I will write the optimization back to xml and make a new drawing in google sketchup.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The first of Gregg's list I would look at is Java3D. It supports 3D primitives. It's also somewhat higher-level than JOGL.

You'll find both on
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

JOGL is a wrapper around OpenGL, a quite low-level 3D graphics library. It is only interesting if you want to work with 3D graphics.

LWJGL (I guess that's what Gregg meant instead of JWJGL) is a game programming library.

Java3D will probably be more useful to you.
[ June 26, 2008: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: 3d objects in java
It's not a secret anymore!