java-3d

J3D - How to use a UV mapping of an object to convert 2D coordinates to 3D ones

孤者浪人 提交于 2019-12-11 14:26:08
问题 I am currently working on trying to convert 2D coordinates to 3D ones. Basically, I have the texture in 2D and I would like to be able to show on a 3D object, having the same texture applied to it, where I am pointing at. Let's say I have the 2D texture of the world. I would like to be able to know, given U,V coordinates on the texture, to get the X,Y,Z coordinates on a sphere having the same texture applied to it. I am using J3D and now I am working with blender and figure out what is the

Java3D with Canvas3D and button overlapping

懵懂的女人 提交于 2019-12-11 09:34:56
问题 i've been doing some introduction to solidstate physics with using Java3D. After delving into many 3D things inside, decided to put some buttons to test different things. My problem emerged here. In the below picture, i was using setLayout(null) to place buttons and Canvas3D: What i did not want here is: Canvas3D overlaps buttons. Canvas3D does not stretch to keep same ratio of picture size / window size so when i resize window it just is in same size. Then i tried using setLayout(new

How do I dynamically load the Java3D library?

为君一笑 提交于 2019-12-11 04:55:22
问题 I am finishing up a game that I developed using Java3D. Since Java3D does not come with the standard JRE, all of the people who I am giving this game to will have to download Java3D. Some of my friends are a little less computer savvy so I thought it would be a lot less work to just write the Jars to the disk and dynamically load them in Java. Is there a better solution to this? Or is dynamically loading the Jars the way to go? I have installed Java3D on another computer of mine from here:

How to pause and resume a simple game in Java

时光怂恿深爱的人放手 提交于 2019-12-11 04:07:30
问题 i made simple game by java , it's about "tennis background" and "tennis ball" , and the ball is randomally move automatically , my game consist of two file , 1st file fore Jpanel , and 2nd file for JFrame , my question is : i need to control of "stopping and resuming" the ball by clicking the mouse , i tried to put wait() during thread running loop , but it's faild , i don't know what is the reason ! , so please review my code and then tell me what is the wrong , and what is the true method

Blinking when swapping JPanel content

北战南征 提交于 2019-12-11 02:54:54
问题 I'm working on a project using Java3D and Jmol (it's a viewer for chemical structures in 3D). I have to create view that is able to switch between Java3D and Jmol representation of structures. I have managed to do that, but when I swap JPanels with JmolPanel and Canvas3D in them, I get blinking of the swapped area. I'm swapping panels simply by doing: public static void changeView(JPanel c) { c.removeAll(); if (var) { c.add(canvas); } else { c.add(jmolPanel); } c.revalidate(); var = !var; }

Java3D universe size is too small to fit object

心不动则不痛 提交于 2019-12-11 02:53:12
问题 The default universe bounds are x=[-1 meter,1 meter], y=[-1,1] and z=[-1,1]. When objects intersect these bounds they are rendered only partially. How can I set another universe size? 回答1: Well actually, the Default Universe technically is unlimited, it is a virtual universe after all. This is how the Java3D universe works: Source: http://java.sun.com/developer/onlineTraining/java3d/j3d_tutorial_ch1.pdf (Page 1-11) So the universe is not too small, your object is just simply too big for the

Can comments make any difference during the run-time?

别等时光非礼了梦想. 提交于 2019-12-11 02:49:29
问题 Reading What is the best comment I've encouter this comment, upvoted 201 times: A long time ago, I accidentally fixed a segfault in Java3D by adding a comment. It was 100% reproducible; if I removed the comment, it crashed. As long as the comment was there, it worked fine. I assume it was some bizarre timing issue, but I never did figure out exactly what was happening. Is this possible? If he was fixing a segfault in Java3D, I'm guessing he was writing code in Java or C/C++. I thought that in

Strange effect painting beautiful colored haze in the air with java3d

对着背影说爱祢 提交于 2019-12-11 02:45:06
问题 I have a strange effect that I would like to understand. Based on this https://stackoverflow.com/a/26384859 example code I changed only two lines: // pAtt.setCullFace(PolygonAttributes.CULL_NONE); <-- old pAtt.setPolygonMode(PolygonAttributes.POLYGON_LINE); // <-- new I was expecting to see a (colored) wire frame of the original 4 sided pyramid. But it paints a beautifully colored haze in the air while it is rotating. Edit: this has been open as a simple question (is it a bug? / reproducible

Why am I getting ClassNotFoundExpection when I have properly imported said class and am looking at it in its directory?

↘锁芯ラ 提交于 2019-12-10 19:55:14
问题 This is my Javac compiling statement: javac -cp "C:\java\code\j3D\j3dcore.jar;C:\java\code\j3D\j3dutils.jar;C:\java\code\j3D\vecmath.jar" Simple.java compiles with no problems. The three jar files ( j3dcore , j3dutils , and vecmath ) are the essential jar's for my program (or at least I am led to believe according to this official tutorial on J3D For the record I ripped this code almost line from line from the above pdf file. jar files are correctly located in referenced locations When I run

Rotate around a specific point in Java3D

二次信任 提交于 2019-12-10 11:07:14
问题 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