Date: Fri, 29 Mar 2024 04:48:57 +0000 (UTC) Message-ID: <1899989026.1267.1711687737474@34fc92c9345b> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1266_1090129910.1711687737474" ------=_Part_1266_1090129910.1711687737474 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This page contains the list of 3D features schedule for JavaFX 8.0
We have been thinking about the possible 3D features for JavaFX 8 for a = while. We are now ready to present the plan to the community for review. Th= is information has also been presented at this year's JavaOne 3= D Made Easy with JavaFX technical session.
Three umbrella JIRA issues were created to capture most of the work: Movable Camera , 3D Geometry= , and 3D Attributes
Here this a link to FX Experience blog on JavaFX 3D Early Access
A list simple examples
Specifying a fixed Camera (existing 2.2 API)
// Crea= te a camera and add it to the Scene Camera camera =3D new PerspectiveCamera(); scene.setCamera(camera);
Specifying a movable Camera
// Crea= te a camera and add it to the Scene Camera camera =3D new PerspectiveCamera(); scene.setCamera(camera); // Add camera to scene graph (so it can move) Group cameraGroup =3D new Group(); cameraGroup.getChildren().add(camera); root.getChildren().add(cameraGroup); // Rotate the camera camera.rotate(45); // Move the cameraGroup (camera moves with it) cameraGroup.setTranslateZ(-75);
Defining a MeshView
// Crea= te the arrays of positions, texCoords float[] positions =3D createPositions(); float[] texCoords =3D createUVs(); // Create faces (indices into the positions, texCoord arrays) int[] faces =3D createFaces(); // Create a mesh TriangleMesh mesh =3D new TriangleMesh(); mesh.setPositions(positions); mesh.setTexCoords(texCoords); mesh.setFaces(faces); // Create meshView MeshView mv =3D new MeshView(mesh);
Using Predefined Shapes
// Crea= te a sphere with the given radius Sphere sphere =3D new Sphere(10.0); // Create a sphere with the given radius, number of divisions Sphere sphere =3D new Sphere(10.0, 40); // Create a cylinder with the given radius, and height Cylinder cylinder =3D new Cylinder(10.0, 30.0); // Create a box with the given width, height, and depth Box box =3D new Box(1.0, 1.0, 1.0); // NOTE: Predefined 3D shapes are centered at (0,0,0)
Defining Lights
// Crea= te point light and add it to the Scene PointLight light =3D new PointLight(); light.setColor(Color.RED); scene.getLights().add(light); // Add light to scene graph (so it can move) Group lightGroup =3D new Group(); lightGroup.getChildren().add(light); root.getChildren().add(lightGroup); // Rotate the light light.rotate(45); // Move the lightGroup (light moves with it) lightGroup.setTranslateZ(-75);
Defining Materials
// Crea= te material Material mat =3D new PhongMaterial(); Image diffuseMap =3D new Image("diffuseMap.png"); Image bumpMap =3D new Image("normalMap.png"); // Set material properties mat.setDiffuseMap(diffuseMap); mat.setBumpMap(normalMap); mat.setSpecularColor(Color.WHITE); // Use the material for a shape shape3d.setMaterial(mat);
Proposed API to support 3D picking: Picking3dAPI
public = double computeAreaInScreen()
public = Point3D sceneToLocal(Point3D scenePoint) public Point3D sceneToLocal(double sceneX, double sceneY, double sceneZ) public Point3D localToScene(Point3D localPoint) public Point3D localToScene(double x, double y, double z) public Point3D parentToLocal(Point3D parentPoint) public Point3D parentToLocal(double parentX, double parentY, double parentZ= ) public Point3D localToParent(Point3D localPoint) public Point3D localToParent(double x, double y, double z)