I want to have faces from the points inside PointArray(color and point size)

I have number of 10 of 2D pointarrays together and at the back of each other to create a pointcloud of 3D. I have used PointArray, Appearance, PointAttributes and J3DApplet to simulate this project.

I am at the last stage of a project and I am to convert a pointcloud into a meshed/trianglemeshed/interpolated 3D view or what you propose.

In other forums about Java, it is written that JMonkeyEngine libraries can handle what I need. It has developed so much to do more things and also little things such as what I need.

I may think of conducting/constructing/writing new methods to create faces between points and color those faces with color of points inside the PointArray.

It would be the most useful thing for me to have a “…Test.java” kind of file to compile and see what it does with how it is written.

Regards

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes. Contains a link to a testCustomMesh.java.

1 Like
@loopies said: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes. Contains a link to a testCustomMesh.java.

Thank you for the website; when I compile the test code, process is completed. However, when I try to run the code, I get the problems below:

[java]Nis 01, 2014 2:49:10 PM com.jme3.system.JmeSystem checkDelegate
SEVERE: No JmeSystemDelegate specified, cannot instantiate default JmeDesktopSystem:
{0}
java.lang.ClassNotFoundException: com.jme3.system.JmeDesktopSystem
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.jme3.system.JmeSystem.checkDelegate(JmeSystem.java:125)
at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:96)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:129)
at jme3test.model.shape.TestCustomMesh.main(TestCustomMesh.java:56)

Exception in thread “main” java.lang.NullPointerException
at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:97)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:129)
at jme3test.model.shape.TestCustomMesh.main(TestCustomMesh.java:56)

Process completed.[/java]

Probably I could not set the jme3 libraries up. I only downloaded “jME3-core.jar” file and added this archieve in JCreator. I remember that I downloaded and ran an .exe file to handle the “native libraries same pipeline” issue for J3D libraries. Do I encounter the same problem? Do I need install instructions to set up jme3 packages or libraries? Any instructions to handle these exceptions anybody can refer?

Well strongly suggest to understand first how jme interoperates between the packets,

eg core alone is useless, as it is neither android nor ios nor desktop capable.

1 Like

I see a jme3-desktop.jar in my librairies, and it contains JmeDesktopSystem. So you will need more librairies.

I guess you are using eclipse, so maybe check: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:setting_up_jme3_in_eclipse.

Or just use the full jmonkey sdk. In the settings panel you can ask it to use eclipse shortcuts.

1 Like
@loopies said: I see a jme3-desktop.jar in my librairies, and it contains JmeDesktopSystem. So you will need more librairies.

I guess you are using eclipse, so maybe check: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:setting_up_jme3_in_eclipse.

Or just use the full jmonkey sdk. In the settings panel you can ask it to use eclipse shortcuts.

I am using JCreator =( neither NetBeans nor Eclipse unfortunately =(. But I will try to download the jme3-desktop.jar as “loopies” refer and try to add the archieve into JCreator and I will share the result here if you want to read. I really wan to work with JME3 in JCreator; however, whether if I really need to change the editor I use or not, I wait for advices.

Regards

Read the manual. The information is global, you just need to know how you apply it in your favorite IDE.

I have handled the libraries and now I can run sample codes. Can we use the “mesh()” object to use the points(with [java]point3f[/java] and [java]color4f[/java]) inside a [java]PointArray[/java]? Do we have a mesh attribute as we have [java]PointAttributes[/java] in Java? Such as, we may have an [java]Appearance[/java] object and we may set its attribute as:

The code below works:

[java]Appearance pa= new Appearance();
pa.setPointAttributes(new PointAttributes(pointSize, bAliased));
Shape3D pointShape = new Shape3D(cloud, pointApp);//instead of shape3d, we may use mesh3d extends shape3d
addChild(pointShape);[/java]

Is the code below possible to implement or what changes it needs? Any advices? I did not run it, I just need software developers/testers’ any ideas to realise this project.

[java]Mesh mesh = new Mesh();

for (int i=0; i<pointArray.getSize();i++){
m.addNode(pointArray.getPoint(i)); //
}

Appearance a = new Appearance();
a.setMeshAttributes(new MeshAttributes(…triangular…? , …clockwise…? , …));
Shape3D meshShape = new Shape3D(pointArray, mesh);
addChild(meshShape);
[/java]

Source code for the Mesh class is available on the web. You may also be able to find it by searching in the IDE. There are settings for point size and line width. Colors would be specified via the material.

Well I am sorry but codes written inside the Mesh class are not actually what I need to observe. I need to know firstly that,

Will I be able to use the points genetared inside my code with coordinates and colors with Mesh class? (or more?)
Will I be able to add the Mesh() object to an Appearance object with some attributes? Cause I want to show them in a view platform of J3D.

I wish I did have a test code which sets mesh on a sample pointcloud or a pointarray in Java.

I’m trying to understand what info is missing in the test I pointed you to? It takes points (vertexes) and organizes them into triangles (also called faces).
The material would be your “appearance”.
The test shows you what jme expects. So transform/feed your exotic (for jme) pointarrays, cloudpoints, whatever, into the data jme expects.
And yabadi, yabada, you are done.

@SarpEnginDaltaban said: Will I be able to add the Mesh() object to an Appearance object with some attributes? Cause I want to show them in a view platform of J3D.

What is J3D? JME is not Java3D is not JME. These are competing things. Use one or use the other, really.