javafx-3d

How to merge multiple 3D objects as a single Mesh in order to remove a visual glitch?

◇◆丶佛笑我妖孽 提交于 2020-01-15 08:55:50
问题 I've been doing a lot of voxel terrain generation with JavaFX 3D. For some reason, whenever I generate a landscape, the right side of the landscape will always have these weird black lines. I've tried changing the PerspectiveCamera 's near and far clip values, but they seem to have no effect. In case you need it, my near clip value is set to 0.1 and my far clip value is set to 100000.0 . Here is a picture of my program, as you can see, there are clear visual glitches present mainly on the

Torus 3d in javaFX 2.x

一世执手 提交于 2019-12-25 02:16:05
问题 I've Stage which is divided by Split Panel, and I wants on the right pane create a 3D torus. First: I don't know what can I create torus. Second: I don't know on what kind of obiect can I create this Torus. Pane enough? Please for help. 回答1: You won't be able to create an embedded 3D scene with a Torus using JavaFX 2.x without a lot of custom coding on your part. However this becomes easy if you use JavaFX 8 and the third party 3D library F(X)yz: http://birdasaur.github.io/FXyz/ F(X)yz has a

Apply gradient to sphere object with JavaFX

泪湿孤枕 提交于 2019-12-23 17:00:50
问题 I'm working in JavaFX for a class, and I'm trying to apply a gradient to a sphere, but (obviously), I can't figure out how to do it. I'm stuck because I know that a sphere is an object, and so it needs to have a material, but (as far as colors go), a PhongMaterial only takes one color, and so it won't take a gradient because a gradient is a range of colors. So basically what I'm trying to is the following: Sphere sphere = new Sphere(50); RadialGradient rg = new RadialGradient(0, 0, 0, 0, 5,

Rotate object around center in Javafx

回眸只為那壹抹淺笑 提交于 2019-12-23 04:45:26
问题 My application read obj file using interactive mesh library and save it it in meshview. What I want is to rotate the object around its center. Right now my code displays the object but when I rotate it, it is rotated around some point which cause the object to go outside the window. I rather want to rotate the object around its center. I know I have to translate object to origin then rotate then translate again, but I don't know how to do. This is my code: public class JavaFx3DObj extends

How to overlay GUI over 3D scene in JavaFX?

拈花ヽ惹草 提交于 2019-12-21 20:44:36
问题 I have a 3D scene in JavaFX and need to overlay GUI over the 3D scene. I have tried adding buttons and text to the scene but they always appear in the 3d view as 3D objects. I have looked around and haven't found how to do it. The only workaround would be creating a whole new window and putting the settings there but that isn't an option in this case. Thanks for the help!! Something like this Or this 回答1: The best solution for what you are looking for is the SubScene , a built-in JavaFX

Why is the diffuse map not applied to my MeshView?

岁酱吖の 提交于 2019-12-21 02:57:50
问题 Problem I'd like to apply a diffuse map to a MeshView. When I apply a Material with the diffuse map to the MeshView, it's not visible. The same material applied to a Box however is visible. Question What do I have to do to apply a diffuse map to a MeshView? Code The code generates an Image with random noise. The image is used as diffuse map in a PhongMaterial. The image is displayed, above it the box with the material applied, and above the box the MeshView (a pyramid) with the material

How to get 2D coordinates on window for 3D object in javafx

倖福魔咒の 提交于 2019-12-17 17:13:46
问题 In javafx if we have 2D HUD (made of Pane and then out of it we create SubScene object for 2D Hud) and 3D SubScene and inside 3D scene we have some object with coordinates (x,y,z) - how can we get 2D coordinates in our HUD of the object if it is in visual field of our perspective camera? I tried to get first Scene coordinates of the object and then convert it (sceneToScreen) coordinates and the same for point (0,0) of Pane and then to subtract first point from second point but i don't get

JavaFX 3D rotations

两盒软妹~` 提交于 2019-12-14 02:58:32
问题 My problems are: the below code is based on the "MolecularSampleApp" from the oracle tutorial site, but very much simplified. It only shows a box and a red sphere for orientation purpose. The sequence of rotations is around x-axis then y-axis and finally z-axis. Following rotations are apparently done in coordinate-axes that are rotated with the rotations before. (I checked that again and again with a cube and sequences of 90° rotations) So, when the user rotates the camera view with the

javafx - How to apply yaw, pitch and roll deltas (not euler) to a node in respect to the nodes rotation axes instead of the scene rotation axes?

允我心安 提交于 2019-12-13 15:23:20
问题 Please bear with my long question, I am trying to make it as clear as possible. (As found in another question.) In the example below, all rotate buttons are a test replacement for the gyro values coming in from a gyroscope sensor. The sensor is fixed to the real world torso, so the buttons are meant to represent rotation deltas to be applied to the virtual torso in respect to the torsos coordinate system, not the scene coordinate system. All buttons work fine by themselfs if starting from a

JavaFX Rotating Camera Around a Pivot

ぃ、小莉子 提交于 2019-12-12 16:32:07
问题 Last year I posted a similar question, but due to it not being very descriptive and overall a mess I decided to rewrite it completely. I am making a simple 3D editor in JavaFX that has a camera movement similar to Blender or pretty much any other one. I added the rotation around the x-axis and then using trigonometric functions I calculated the other 2 rotations (y and z-axis). Both x and y-axis rotations are made relative to the pivot point, but the z rotation is always made relative to the