javafx-3d

How to convert a MeshView to a CSG object using JCSG library in JavaFX

走远了吗. 提交于 2019-12-10 07:04:21
问题 I'm using the JCSG library for JavaFX. I have some MeshView objects that I want to convert them into CSG objects, is there a way to achieve this? 回答1: The easiest way to combine a javafx.scene.shape.Mesh object with a CSG one, providing you have a TriangleMesh is converting the triangular faces to polygons ( eu.mihosoft.vrl.v3d.Polygon ). Once you have a CSG object you can perform the regular operations on it, and then you can export it back to a MeshView for instance. The problem with

How to render 3D graphics properly

不问归期 提交于 2019-12-08 05:32:05
问题 I was trying to make a rubiks cube in javafx an ended up with a very bad model as given in this Image. I am giving my source for code for this, where I have used RectangleBuilder class to create rectangles and transformed in 3d. To fix the graphics i had also tried to build the rectangles used TriangleMesh class and after adding materials to them, transformed them in 3d to end up again in the same bad graphics. Why does this occur and how to get rid of it ? import javafx.scene.transform

JavaFX 8 3D scene intersection point

僤鯓⒐⒋嵵緔 提交于 2019-12-06 23:52:13
问题 Is it possible in a JavaFX 8 3D scene to find points along a ray (e.g. PickRay), starting at an arbitrary point in 3D space with some 3D direction vector, where the ray intersects the triangles in a mesh (TriangleMesh inside a MeshView)? I know this is done in the Camera/MouseHandler for mouse picking but I can't see any way for doing it for arbitrary rays. 回答1: As @jdub1581 suggests, a ray is just a geometric vector, so in order to find a list of triangles intersected by this vector we need

How to render 3D graphics properly

一笑奈何 提交于 2019-12-06 15:39:58
I was trying to make a rubiks cube in javafx an ended up with a very bad model as given in this Image . I am giving my source for code for this, where I have used RectangleBuilder class to create rectangles and transformed in 3d. To fix the graphics i had also tried to build the rectangles used TriangleMesh class and after adding materials to them, transformed them in 3d to end up again in the same bad graphics. Why does this occur and how to get rid of it ? import javafx.scene.transform.Rotate; import javafx.scene.PerspectiveCamera; import javafx.scene.transform.Translate; import javafx

customizing javafx 3d box or rotating stackpane

坚强是说给别人听的谎言 提交于 2019-12-06 11:23:25
问题 My goal is a game played with dice. I am using javafx. First question: Is there an easy way to customize the 3d box in javafx. It doesn't matter to me, if I have to add an image to every side of the die or if I use just one image which wraps around the box. (After lots of research I didn't find anything about it.) In the code below I created a stackpane, which is a 3d cube. It is build from 6 Rectangles, each of the is filled with one side of a die (1 to 6). If I rotate the stackpane by 180

What is use of getNormals() method in TriangleMesh JavaFX

和自甴很熟 提交于 2019-12-06 10:55:09
问题 I am currently working of JavaFX 3D application and come across getNormals() method in TriangleMesh class. As in TriangleMesh class is used to create user defined Java FX 3D obejct and in that getPoints() is used to add Points getFaces() is used to add Faces getTexCoords() is used to manage Texture of 3D Object, but I am not sure what is use of getNormals() method in TriangleMesh class. In TriangleMesh class, we can set vertex format to VertexFormat.POINT_TEXCOORD and VertexFormat.POINT

Showing texts over the face of a Box based on the visible area on zooming in/out

偶尔善良 提交于 2019-12-06 08:55:45
问题 I have a sample 3D application (built by taking reference from the Javafx sample 3DViewer) which has a table created by laying out Boxes and Panes: The table is centered wrt (0,0,0) coordinates and camera is at -z position initially. It has the zoom-in/out based on the camera z position from the object. On zooming in/out the object's boundsInParent increases/decreases i.e. area of the face increases/decreases. So the idea is to put more text when we have more area (always confining within the

Restricting a 3D object mouse drag movement to a plane in JavaFX

杀马特。学长 韩版系。学妹 提交于 2019-12-06 02:33:08
问题 I'm using JavaFX to move 3D cubes around by mouse drag. The cube should stay on the plane spanned by x and z axis. My solution works fairly well, however if I move the cube too fast with my mouse or when it encounters an object with a certain depth (y-Axis), it is assumed, that the mouse is moving on the y-Axis and the cube starts jumping forward or backwards. Is there a way to restrict the mouse to the xz-plane? A more complicated solution would be projecting the y length back to the xz

How to convert a MeshView to a CSG object using JCSG library in JavaFX

落花浮王杯 提交于 2019-12-05 15:01:15
I'm using the JCSG library for JavaFX. I have some MeshView objects that I want to convert them into CSG objects, is there a way to achieve this? The easiest way to combine a javafx.scene.shape.Mesh object with a CSG one, providing you have a TriangleMesh is converting the triangular faces to polygons ( eu.mihosoft.vrl.v3d.Polygon ). Once you have a CSG object you can perform the regular operations on it, and then you can export it back to a MeshView for instance. The problem with primitive shapes ( Box , Sphere , ...) is that you don't have access to their TriangleMesh . So you can go to F(X

How to render 3D text in JavaFX?

陌路散爱 提交于 2019-12-05 11:43:20
I'm making my first JavaFX project and I need to render some 3D text. I already put a PerspectiveCamera and I display a text node but it has a Z-dimension of 0 and I don't know how to change this. Thanks in advance! Have a look at the FXyz project. It already contains a Text3DMesh class that will allow you generating a 3D mesh for any string and font you need. Under the hood there is a complex process of converting (2D) Text to Path, Delaunay triangulation and mesh extrusion. As a result, you have a 3D mesh that can be easily rendered and textured (solid color, density map, images). Have a