SlideShare a Scribd company logo
1
Basic Topics:
 What is JavaFX ?
 JavaFX 3D Overview
 3D Shapes in JavaFX
 Add camera
 Add lighting
 Apply shape materials
 Interacting with 3D Shapes
2
JavaFX
 JavaFX is a graphical user interface (GUI) from Oracle.
 It provides lightweight , hardware-accelerated platform.
 As of version JDK 7 , it comes included with the Java install.
3
4
Overview
 JavaFX 3D graphics features currently available through the Java 8 APIs
for JavaFX.
 The JavaFX 3D graphics APIs provide a general purpose three-
dimensional graphics library for the JavaFX platform. We can use 3D
geometry, cameras, and lights to create, display, and manipulate objects
in 3D space.
 Some Samples of JavaFX 3D Graphics Use Case:
3D Charting Mechanical CAD Entertainment
5
3D Shapes
 A point in 3D space is represented as (x,y,z).
 The dimensions identify the width , height and depth.
X
Z
Y
To check to see if your computer supports
3D graphics, you can use this statement in
Java :
System.out.println(Platform.isSupported(C
onditionalFeature.SCENE3D));
6
 nodes are rendered in the order that they're added to the scene
graph.
 For the correct order, we can specify that the scene needs a depth
buffer.
 For example :
boolean depthBuffer = true;
Scene scene = new Scene(root,300,300, depthBuffer);
 To view shapes with a Z value, a camera must be added.
3D Shapes 7
 All shapes have a material, draw mode, and cull face.
 Material gives shapes color.
 Draw mode indicates how the shape is rendered.
 face culling is a technique used to only render the visible
portions of your 3D image.
3D Shapes 8
 All shapes are made up of triangles.
 A box has 12 triangles.
 Shapes are nodes ,so we can apply transformations.
 They can be positioned at any point using the translateX,
translateY,and translateZ transformations.
3D Shapes 9
3D Shapes
Pre-defined Shapes
User-Defined Shapes
Shapes3D.java
10
 To create 3D shapes, we use a triangle mesh.
 JavaFX has a MeshView class to represents user-defined 3D
shapes.
 A triangle mesh needs data for three aspects of a 3D object :
texture coordinates, points and faces.
User-Defined Shapes 11
 The texture is an image is of a 2D object mapped to the vertices
of the triangles.
 Points are the vertices of the triangles in the mesh.
 faces are the planes created by joining these vertices.
User-Defined Shapes
PyramidExample.java
12
 By default, the scene is a 2D image.
 To view third dimension, you add a camera.
 the camera coordinate system is as follows:
x-axis is pointing to the right.
y-axis is pointing down.
z-axis points away from the viewer
Add Camera 13
 The camera sets the viewing perspective of having a
third dimension.
 A camera is a node in JavaFX.
 When adding a camera, we can specify clipping panes.
Add Camera
Shapes3D_with_camera.java
CameraExample.java
14
Add Lighting
 Light is also a node in Java FX.
 Ambient and point light represent light from external source.
 Each light node can a different color.
 Ambient Light is a non-directional light.
 Point Light represents appoint light source.
 This is a fixed point in space and radiates light equally in all
direction.
 The intensity decreases as the distance increases. Shapes3D_with_light.java
15
Shape materials
 Shading material mixes light, color, and shade .
 This gives the illusion of a 3D effect.
 A special type of shading material called Phong.
 Phong shading is a technique used to render 3D objects.
MaterialDemo.java
16
Interacting with 3D Shapes
17
In
this
Video
18

More Related Content

PPTX
GRPHICS01 - Introduction to 3D Graphics
PPT
3D Graphics
PPTX
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
PDF
maXbox starter68 machine learning VI
PPTX
COMPUTER GRAPHICS
PPTX
Understand Manifolds using MATLAB
PPTX
Eigenfaces In Scala
GRPHICS01 - Introduction to 3D Graphics
3D Graphics
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
maXbox starter68 machine learning VI
COMPUTER GRAPHICS
Understand Manifolds using MATLAB
Eigenfaces In Scala

What's hot (20)

PDF
Log polar coordinates
PPTX
GRPHICS02 - Creating 3D Graphics
PDF
Computer graphics notes
PDF
02_atiqa ijaz khan_05_2014
PDF
Structure and Motion - 3D Reconstruction of Cameras and Structure
DOCX
dominguez_cecilia_image-processing-manual
PPTX
Java ME - 08 - Mobile 3D Graphics
PDF
Lecture1
PDF
reviewpaper
PDF
BMVA summer school MATLAB programming tutorial
PPTX
Class[5][9th jul] [three js-meshes_geometries_and_primitives]
PDF
maXbox starter65 machinelearning3
PDF
Image processing with matlab
PPTX
Stereo vision
KEY
OpenGL ES for iOS (3D Graphics)
PPT
CS 354 Bezier Curves
PDF
Computer graphics notes watermark
PDF
DESIGN, IMPLEMENT AND SIMULATE AN AGENT MOTION PLANNING ALGORITHM IN 2D AND 3...
PPTX
Face Recognition using PCA-Principal Component Analysis using MATLAB
PPTX
Clipping 22
Log polar coordinates
GRPHICS02 - Creating 3D Graphics
Computer graphics notes
02_atiqa ijaz khan_05_2014
Structure and Motion - 3D Reconstruction of Cameras and Structure
dominguez_cecilia_image-processing-manual
Java ME - 08 - Mobile 3D Graphics
Lecture1
reviewpaper
BMVA summer school MATLAB programming tutorial
Class[5][9th jul] [three js-meshes_geometries_and_primitives]
maXbox starter65 machinelearning3
Image processing with matlab
Stereo vision
OpenGL ES for iOS (3D Graphics)
CS 354 Bezier Curves
Computer graphics notes watermark
DESIGN, IMPLEMENT AND SIMULATE AN AGENT MOTION PLANNING ALGORITHM IN 2D AND 3...
Face Recognition using PCA-Principal Component Analysis using MATLAB
Clipping 22
Ad

Similar to Java fx 3d (20)

PPT
Advanced Game Development with the Mobile 3D Graphics API
DOCX
An Introduction to Computer Science with Java .docx
PPTX
is three.js better for developing web-based 3d games?
PPTX
Class[4][19th jun] [three js-camera&light]
PPTX
COMP340 TOPIC 4 THREE.JS.pptx
PDF
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
PDF
CMSC 197 Journal Reporting
PDF
A PHOTO-BASED AUGMENTED REALITY SYSTEM WITH LOW COMPUTATIONAL COMPLEXITY
PPT
Java Graphics
DOCX
20100117US001c-3DVisualizationOfRailroadWheelFlaws
PPT
Degrafa Overview
DOC
Learn Java 3D
PDF
3D Landscape on Labs
PDF
Hacking the Kinect with GAFFTA Day 3
PDF
Dynamic Graph Plotting with WPF
PDF
CGR-Unit-1 Basics of Computer Graphics.pdf
PPTX
3D Image visualization
PPT
Csc406 lecture7 device independence and normalization in Computer graphics(Co...
PDF
A complete user adaptive antenna tutorial demonstration. a gui based approach...
PDF
Game Engine Overview
Advanced Game Development with the Mobile 3D Graphics API
An Introduction to Computer Science with Java .docx
is three.js better for developing web-based 3d games?
Class[4][19th jun] [three js-camera&light]
COMP340 TOPIC 4 THREE.JS.pptx
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
CMSC 197 Journal Reporting
A PHOTO-BASED AUGMENTED REALITY SYSTEM WITH LOW COMPUTATIONAL COMPLEXITY
Java Graphics
20100117US001c-3DVisualizationOfRailroadWheelFlaws
Degrafa Overview
Learn Java 3D
3D Landscape on Labs
Hacking the Kinect with GAFFTA Day 3
Dynamic Graph Plotting with WPF
CGR-Unit-1 Basics of Computer Graphics.pdf
3D Image visualization
Csc406 lecture7 device independence and normalization in Computer graphics(Co...
A complete user adaptive antenna tutorial demonstration. a gui based approach...
Game Engine Overview
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Cell Structure & Organelles in detailed.
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Institutional Correction lecture only . . .
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Final Presentation General Medicine 03-08-2024.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
01-Introduction-to-Information-Management.pdf
Microbial disease of the cardiovascular and lymphatic systems
VCE English Exam - Section C Student Revision Booklet
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Cell Structure & Organelles in detailed.
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Institutional Correction lecture only . . .
Microbial diseases, their pathogenesis and prophylaxis
O5-L3 Freight Transport Ops (International) V1.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf

Java fx 3d

  • 1. 1
  • 2. Basic Topics:  What is JavaFX ?  JavaFX 3D Overview  3D Shapes in JavaFX  Add camera  Add lighting  Apply shape materials  Interacting with 3D Shapes 2
  • 3. JavaFX  JavaFX is a graphical user interface (GUI) from Oracle.  It provides lightweight , hardware-accelerated platform.  As of version JDK 7 , it comes included with the Java install. 3
  • 4. 4
  • 5. Overview  JavaFX 3D graphics features currently available through the Java 8 APIs for JavaFX.  The JavaFX 3D graphics APIs provide a general purpose three- dimensional graphics library for the JavaFX platform. We can use 3D geometry, cameras, and lights to create, display, and manipulate objects in 3D space.  Some Samples of JavaFX 3D Graphics Use Case: 3D Charting Mechanical CAD Entertainment 5
  • 6. 3D Shapes  A point in 3D space is represented as (x,y,z).  The dimensions identify the width , height and depth. X Z Y To check to see if your computer supports 3D graphics, you can use this statement in Java : System.out.println(Platform.isSupported(C onditionalFeature.SCENE3D)); 6
  • 7.  nodes are rendered in the order that they're added to the scene graph.  For the correct order, we can specify that the scene needs a depth buffer.  For example : boolean depthBuffer = true; Scene scene = new Scene(root,300,300, depthBuffer);  To view shapes with a Z value, a camera must be added. 3D Shapes 7
  • 8.  All shapes have a material, draw mode, and cull face.  Material gives shapes color.  Draw mode indicates how the shape is rendered.  face culling is a technique used to only render the visible portions of your 3D image. 3D Shapes 8
  • 9.  All shapes are made up of triangles.  A box has 12 triangles.  Shapes are nodes ,so we can apply transformations.  They can be positioned at any point using the translateX, translateY,and translateZ transformations. 3D Shapes 9
  • 10. 3D Shapes Pre-defined Shapes User-Defined Shapes Shapes3D.java 10
  • 11.  To create 3D shapes, we use a triangle mesh.  JavaFX has a MeshView class to represents user-defined 3D shapes.  A triangle mesh needs data for three aspects of a 3D object : texture coordinates, points and faces. User-Defined Shapes 11
  • 12.  The texture is an image is of a 2D object mapped to the vertices of the triangles.  Points are the vertices of the triangles in the mesh.  faces are the planes created by joining these vertices. User-Defined Shapes PyramidExample.java 12
  • 13.  By default, the scene is a 2D image.  To view third dimension, you add a camera.  the camera coordinate system is as follows: x-axis is pointing to the right. y-axis is pointing down. z-axis points away from the viewer Add Camera 13
  • 14.  The camera sets the viewing perspective of having a third dimension.  A camera is a node in JavaFX.  When adding a camera, we can specify clipping panes. Add Camera Shapes3D_with_camera.java CameraExample.java 14
  • 15. Add Lighting  Light is also a node in Java FX.  Ambient and point light represent light from external source.  Each light node can a different color.  Ambient Light is a non-directional light.  Point Light represents appoint light source.  This is a fixed point in space and radiates light equally in all direction.  The intensity decreases as the distance increases. Shapes3D_with_light.java 15
  • 16. Shape materials  Shading material mixes light, color, and shade .  This gives the illusion of a 3D effect.  A special type of shading material called Phong.  Phong shading is a technique used to render 3D objects. MaterialDemo.java 16
  • 17. Interacting with 3D Shapes 17 In this Video
  • 18. 18