2D Graphics to 3D package

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

2D Graphics to 3D package

tamb20
Hi,

I have a 2D program and I would like to upgrade it to 3D.

However, I face some issue with Graphics 3D package.

The graphics method in 2D package is:

public abstract void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle);


What I can do to find the method in 3D which needs to add  (int z ) to the method.

I have installed java 3D to my computer. So, which package  I can import to have z direction included.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: 2D Graphics to 3D package

gouessej
Administrator
Hi

Java3D is completely different from Java2D and Java3D 1.6.0 (and 1.7) cannot be "installed", it's just in your classpath, it mustn't be put into the JRE, it mustn't rely on the extension mechanism...

Why not looking at some simple examples (compatible with Java3D 1.6.0, but not with Java3D 1.7.0):
http://java3d.org/samples.html
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: 2D Graphics to 3D package

tamb20
Thank you for replay.
However, the issue is that I already build a 3D system model. I need to extend what  I have to add new trait to it which is path plan. This path plan done in 2D points and its coming from default 2D packages. While I already have a built in 3D points.

Both 3D and 2D programs have different GUI. I need to but the 2D program to a 3D one and run it as a 3D program in one GUI.
     
Reply | Threaded
Open this post in threaded view
|

Re: 2D Graphics to 3D package

runiter
Java3D doesn't have any equivalent method for fillArc. You need to calculate the mesh coordinates yourself.

For that you can use TriangleArray or QuadArray or TriangleFanArray.
Read more about these here:

http://www2.hs-fulda.de/caelabor/inhalte/java/j3d/j3d_seminar/6/Lines,%20Shapes,%20Geometric%20Objects.pdf



Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D