java-3d

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

╄→гoц情女王★ 提交于 2019-12-02 17:47:49
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.universe.*; import java.awt.image.BufferedImage; import javax.media.j3d.*; import javax.media.jai.JAI;

Face coloring in java3d

前提是你 提交于 2019-12-02 01:39:43
问题 Using java3d, how can I colorize not on a per vertex base but on a per face base? I try to learn about java3d but what Shape3d I did produce does not look as expected. I want to colorize different triangles in different colors, but I don't see how to do it. Texture looks like an overkill, and what's more, I haven't mastered this part at all. As far as I've seen Materials work on a complete GeometryArray, so are no good here. Per vertex colors won't do the trick. 回答1: I fond the solution. "per

Face coloring in java3d

你离开我真会死。 提交于 2019-12-02 01:39:13
Using java3d, how can I colorize not on a per vertex base but on a per face base? I try to learn about java3d but what Shape3d I did produce does not look as expected. I want to colorize different triangles in different colors, but I don't see how to do it. Texture looks like an overkill, and what's more, I haven't mastered this part at all. As far as I've seen Materials work on a complete GeometryArray, so are no good here. Per vertex colors won't do the trick. I fond the solution. "per vertex colors" really are per vertex reference, so each vertex can have a different color for each of its

Java3D: Painting 2D HUD over a Canvas3D

眉间皱痕 提交于 2019-12-01 05:52:12
I'm using Java3D to render a three-dimensional scene. I would like to overlay a two-dimensional "heads-up-display" on top of the 3d image. How can I efficiently paint the 2d content on top of the 3d canvas? Thanks! Jim // Create a Canvas3D using the preferred configuration Canvas3D canvas3d = new Canvas3D(config) { private static final long serialVersionUID = 7144426579917281131L; public void postRender() { this.getGraphics2D().setColor(Color.white); this.getGraphics2D().drawString("Heads Up Display (HUD) Works!",100,100); this.getGraphics2D().flush(false); } }; 来源: https://stackoverflow.com

Rotation around a specific point (eg, rotate around 0,0,0)

前提是你 提交于 2019-12-01 00:47:38
I've been searching a lot on this problem, but I couldn't really find an answer that would fit. I need to rotate a cylinder around a given point (eg, 0,0,0), but the pivot of the cylinder is given by default. How do i change that? I found this topic, and it's quite what I would want to do, but I don't know how to do it with java. To explain better what I would like to do, I'll show 3 images.(v) imageshack.us/photo/my-images/259/aintgood.jpg imageshack.us/photo/my-images/840/whatineed.jpg imageshack.us/photo/my-images/705/nogoodn.jpg So, the first image shows my basic problem, the cylinder

Rotation around a specific point (eg, rotate around 0,0,0)

こ雲淡風輕ζ 提交于 2019-11-30 19:05:20
问题 I've been searching a lot on this problem, but I couldn't really find an answer that would fit. I need to rotate a cylinder around a given point (eg, 0,0,0), but the pivot of the cylinder is given by default. How do i change that? I found this topic, and it's quite what I would want to do, but I don't know how to do it with java. To explain better what I would like to do, I'll show 3 images.(v) imageshack.us/photo/my-images/259/aintgood.jpg imageshack.us/photo/my-images/840/whatineed.jpg

3d modelling loading , updating and rendering in java

江枫思渺然 提交于 2019-11-29 15:19:30
i am new to java 3d. i have encountered a situation like , i want to load ready made developed 3d model of any object [as an example shoe] developed in 3d modeling software like 3d studio max or Maya in my java program , update its texture or color properties etc. then render it and then display the updated model to the end user. so i am asking all the 3d experts how should i proceed ahead to accomplish my goal ? which input should i load into my program ? how can i update the loaded model , render it and display the updated model to the end user ? in simple story , i want to give my users

3d modelling loading , updating and rendering in java

老子叫甜甜 提交于 2019-11-28 09:22:28
问题 i am new to java 3d. i have encountered a situation like , i want to load ready made developed 3d model of any object [as an example shoe] developed in 3d modeling software like 3d studio max or Maya in my java program , update its texture or color properties etc. then render it and then display the updated model to the end user. so i am asking all the 3d experts how should i proceed ahead to accomplish my goal ? which input should i load into my program ? how can i update the loaded model ,

Flip a card animation

会有一股神秘感。 提交于 2019-11-28 07:50:44
I'm trying to flip a coloured rectangle. Is it possible to use the rotateTransition to do this? I have tried the following code: public void rotateField(){ RotateTransition rt = new RotateTransition(Duration.millis(3000), field[4][4]); rt.setByAngle(360); rt.setCycleCount(1); rt.play(); } However, this doesn't flip the rectangle, it just rotates it. I would like to actually flip the rectangle as you would flip a playing card. Is it possible to use the rotateTransition class for this? I like Sergey's solution, it is such a clever use of ScaleTransition and working in 2D means you don't need to

problems with java3D lib configuration

北城余情 提交于 2019-11-27 14:07:19
ive ran into some trouble configuring java3D to work with my IDE environment... I have downloaded j3d-1_5_2-linux-i586.zip, and unpacked j3dcore.jar, j3dutils.jar, vecmath.jar, libj3dcore-ogl.so, libj3dcore-ogl-cg.so and added them all as 'Referenced Libraries' within my project folder. this gets rid of any compilation warnings I was getting but when I compile and run the application I get the following exception! Exception in thread "main" java.lang.UnsatisfiedLinkError: no j3dcore-ogl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681) at java.lang.Runtime