java-3d

Canvas3D not appearing in Swing window

馋奶兔 提交于 2019-12-08 05:23:03
问题 I am attempting to insert a Canvas3D object inside a Swing JPanel, but the code doesn't seem to be working (i.e. nothing happens): Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); SimpleUniverse universe = new SimpleUniverse(canvas); BranchGroup root = new BranchGroup(); root.addChild(new ColorCube()); universe.addBranchGraph(root); universe.getViewingPlatform().setNominalViewingTransform(); canvasPanel.add(canvas); What am I missing? The JPanel was created using

Rotate around a specific point in Java3D

霸气de小男生 提交于 2019-12-06 11:06:36
I'm importing 2 models in Java3D, scaling them down and then rotating one of them using a RotationInterpolator However, this rotates the object around the origin. I want to rotate the object around ITS centre, not the scene's. Put simply, I want it to spin in place. How do I rotate around a specific point? TransformGroup rotateTheBlades = new TransformGroup(); rotateTheBlades.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE); Alpha rotationAlpha = new Alpha(-1,5000); RotationInterpolator rotator = new RotationInterpolator( rotationAlpha,rotateTheBlades); Transform3D abc = new Transform3D();

Image rotation in 3D space around Y axis

允我心安 提交于 2019-12-06 07:57:30
I have a BufferedImage and I want to rotate the image (Picture) around the Y axis in Java with theta angle not affine transform. The rotation will be like the image below (the rectangle will be an image). I can do this by rotating each pixel of the image and drawing the image. Because I have to rotate a lot of images, I don't think this is the best idea. How I will do this transformation? Thanks for your help. Generally, you'll want to find the inverse transform from your output pixel space into the input pixel's space. You then iterate over the output pixels, transforming them into the input

How to rotate an object in Java 3D?

ぐ巨炮叔叔 提交于 2019-12-06 06:34:10
问题 I have a Cone I drew in Java 3D with the following code: Cone cone = new Cone(2f, 3f); Transform3D t3d = new Transform3D(); TransformGroup coneTransform = new TransformGroup(t3d); coneTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); t3d.setTranslation(new Vector3f(0f,0f,0f); coneTransform.setTransform(t3d); coneTransform.addChild(cone); this.addChild(coneTransform); Suppose I have the cone sitting at point (1,1,1) and I want the tip of the cone to point down an imaginary line

Java 3D Hello World - Jar freeze

时间秒杀一切 提交于 2019-12-06 00:30:52
Hi guys I'm following this tutorial to build my first Java 3D application. I included in my project the java3D libraries and my DllLoader class that extracts (from the classpath to the jar's location) and loads the j3dcore-ogl.dll : public class DllLoader { private DllLoader() { } public static void extractAndLoad(String dll) throws IOException { int aux = dll.lastIndexOf('/'); if (aux == -1) { aux = dll.lastIndexOf('\\'); } File dllCopy = new File((aux == -1) ? dll : dll.substring(aux + 1)); try { System.load(dllCopy.getAbsolutePath()); } catch (UnsatisfiedLinkError e1) { try { DllLoader

Is there a way to terminate a java application that uses java3d, without calling System.exit()?

我们两清 提交于 2019-12-05 12:58:49
问题 Java3D starts several system threads and doesn't set the isDaemon flag on them. When I dispose the (only) JFrame of my application it won't terminate because these threads are still running. Calling System.exit() seems to be the only way to terminate the application. (Or killing it from outside, of course). As I don't like to call System.exit() I have tried the following (but without success): calling removeAllLocales() on the VirtualUniverse: This terminates most of the threads, but still

Is it possible to run Java3D applications on Nvidia 3D Vision hardware?

旧城冷巷雨未停 提交于 2019-12-03 16:32:13
问题 Is is possible to run a Java3D application on Nvidia 3D Vision hardware? I've got an existing Java3D application that can run in stereoscopic 3D. In the past, I've always run the application on Quadro cards using the OpenGL renderer and quad buffered stereo. I now have access to a laptop with the nVidia 3D Vision system (with a GeForce GTX 460M). From the documentation, it seems like it should be possible to run my application in stereo if I use the DirectX bindings and let the nVidia drivers

Is it possible to run Java3D applications on Nvidia 3D Vision hardware?

不打扰是莪最后的温柔 提交于 2019-12-03 06:28:43
Is is possible to run a Java3D application on Nvidia 3D Vision hardware? I've got an existing Java3D application that can run in stereoscopic 3D. In the past, I've always run the application on Quadro cards using the OpenGL renderer and quad buffered stereo. I now have access to a laptop with the nVidia 3D Vision system (with a GeForce GTX 460M). From the documentation, it seems like it should be possible to run my application in stereo if I use the DirectX bindings and let the nVidia drivers take care of the stereo, however, this does not seem to be the case. If I run a Java3D application

How to draw simple 3D points(x,y,z) in java using Java3D API?

大城市里の小女人 提交于 2019-12-03 04:40:54
问题 I am making a desktop app in netbeans platform using Java technology. I did some image processing, database functionality, image capturing process; but now I want to draw images in 3D view. So, I think first of all I have to make point array of my .tiff 16 bit gray scale image and then use this point array. I tried something and my code is below, but it does not work. So how should I use this point array to draw my image in 3D view? import java.awt.BorderLayout; import com.sun.j3d.utils

jMonkey optimization similar to Java3D's

北慕城南 提交于 2019-12-02 20:11:00
Edit: For having real-time drawing, started using lwjgl which is base of jmonkeyengine and jocl in an "interoperability" between opengl and opencl, now can calculate and draw 100k particles real-time. Maybe mantle version of jmonkey engine can cure this drawcall overhead problem. For several days, I have been learning jMonkey engine(ver:3.0) in Eclipse(java 64 bit) and trying how to optimize a scene with using GeometryBatchFactory.optimize(rootNode); command. Without optimization(with capability of changing spheres positions): Okay, only 1-fps is originated from both pci-express bandwidth+jvm