JavaFX 3D : Bringing Duke to Life John Yoon Interaction, Visual, and 3D Designer Oracle October 1, 2014
Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 4
Program Agenda Backstory JavaFX 3D Overview JavaFX 3D Production Pipeline JavaFX 3D Data Pipeline Questions 5
Program Agenda Backstory JavaFX 3D Overview JavaFX 3D Production Pipeline JavaFX 3D Data Pipeline Questions 6
Currently Interaction and Visual Designer in the Java Organization Working on Java SE Commercial Enterprise Products 7
Previously An early contributor/user of Maya Software Studied at the UCLA Film School Worked at Disney as a Character TD Chicken Little, Meet the Robinsons, Worked at DreamWorks as a Character TD How to Train Your Dragon, Shrek Forever After 8
JavaFX 3D Backstory 3D Research started at Sun (2008-2010) JavaFX 3D Prototype (2011-2012) JavaOne 2011: Duke 3D Kinect JavaOne 2012: Navis / Canoo 3D Shipping Port JavaFX 3D in JDK 8 (2013 EA, 2014 GA) JavaOne 2013: Duke 3D Chess Animated 9
Program Agenda Backstory JavaFX 3D Overview JavaFX 3D Production Pipeline JavaFX 3D Data Pipeline Questions 10
What is JavaFX 3D?!! JavaFX 3D is a general-purpose 3D graphics library for JavaFX 11
JavaFX 3D Overview JavaFX 3D leverages the 2D UI capabilities of JavaFX JavaFX 3D shares the same scene graph with JavaFX JavaFX 3D is not a thin wrapper around OpenGL/D3D JavaFX 3D is not a AAA game engine JavaFX 3D is easy to learn and use Check out MoleculeSampleApp.java 12
JavaFX 3D Overview MoleculeSampleApp 13
JavaFX 3D Use Cases Scientific and Engineering Visualization Mission, Inventory, Process Visualization Mechanical CAD and CAE Visualization Architectural Visualization and Walkthrough 3D Charting Casual Games 14
JavaFX 3D Use Cases Scientific: Michael Hoffer and Zoran Sevarac Mission Planning: for NASA, Sean Phillips Mechanical CAD: jfxscad, Michael Hoffer Architectural: historical structures, Jose Pereda 3D Charting: JavaOne 2011 3D keynote demo Casual Games: 3D Chess; Jose s Leap Motion demo 15
JavaFX 3D Overview Duke 3D Chess Animated 16
Program Agenda Backstory JavaFX 3D Overview JavaFX 3D Production Pipeline JavaFX 3D Data Pipeline Questions 17
JavaFX 3D Production Pipeline Modeling 3D Polygons Subdivision Surfaces Building a Transform for 3D 3D Skinning or Parenting to Transforms 3D using Tangent Interpolators 18
JavaFX 3D Production Pipeline Modeling Building Transform Skinning or Parenting 19
Modeling Modeling Building Transform Skinning or Parenting 3D Modeling Tools! Blender (Free!) Maya 3D Studio Max Lightwave Cheetah 3d Cinema 4d SketchUp Modo 20
Modeling Modeling Building Transform Skinning or Parenting 3D File Formats FBX: Popular Autodesk file format COLLADA (DAE): Open standard XML schema OBJ: Old format for polygon meshes, but still used STL: For Stereolithography and 3D printing 21
Modeling Modeling Building Transform Skinning or Parenting 3D Viewer Viewer for 3D geometry, skinning, animation Free, open-source, a lot of useful functionality Written to help us prepare JavaOne demos Experimental, rather than production code 22
Modeling Modeling Building Transform Skinning or Parenting 3D Viewer Importers Maya: Imports general polygons and triangles OBJ: Only imports triangles, not general polygons 3D Studio Max: Donated but untested DAE: Just a start 23
Modeling Modeling Building Transform Skinning or Parenting Other Importers (not part of 3D Viewer) FBX Importer by Tesis Dynaware source code at https://github.com/tesis-dynaware/fbx-importer 3ds, COLLADA, OBJ, STL Importers by August Lammersdorf http://interactivemesh.org 24
Modeling Modeling Building Transform Skinning or Parenting Triangles vs. General Polygons Ultimately, all geometry gets turned into triangles However, keeping geometry as polygons for as long as possible has advantages for subdivision surfaces In animation, quads are preferred over triangles 25
Modeling Modeling Building Transform Skinning or Parenting! Demo of Triangle vs Quad Cubes in Maya and JavaFX 3D 26
Modeling Modeling Building Transform Skinning or Parenting Catmull-Clark Subdivision Surfaces is a generalization of a recursive bicubic B-spline patch subdivision algorithm. For rectangular control-point meshes, the method generates a standard B-spline surface. Edwin Catmull and Jim Clark, 1978 http://www.cs.berkeley.edu/~sequin/cs284/papers/catmullclark_sdsurf.pdf 27
Modeling Modeling Building Transform Skinning or Parenting! Demo of Triangle vs Quad Cubes in Maya and JavaFX 3D with and without subdivision surfaces 28
Modeling Modeling Building Transform Skinning or Parenting Duke was designed by Joe Palrang!!! https://duke.kenai.com/wave/wave.jpg 29
Modeling Modeling Building Transform Skinning or Parenting Duke was originally modeled in 3D by James Gosling!!! 30
Modeling Modeling Building Transform Skinning or Parenting Duke was remodeled for animation for JavaFX 3D!!! 31
Modeling Modeling Building Transform Skinning or Parenting Demo of Duke and Chess Hats in Maya and JavaFX 3D with and without subdivision surfaces! 32
Modeling Modeling Building Transform Skinning or Parenting Model Resolution and Topology Matter for You don t want the resolution too high. Leave that for subdivision surfaces You don t want the resolution too low. If the resolution is too low, the mesh doesn t deform right when animated. 33
Rigging / Character Setup Modeling Building Transform Skinning or Parenting In order to animate a 3D model, you need a transform hierarchy to which the 3D geometry is attached. The general term for this part of the pipeline is rigging or character setup. Rigging is the process of setting up your static 3D model for CG animation, to make it animatable. 34
Building Transform Modeling Building Transform Skinning or Parenting Demo of Joints and Transforms in Duke! Maya Outliner 35
Building Transform Modeling Building Transform Skinning or Parenting 36
Skinning or Parenting Modeling Building Transform Skinning or Parenting! Skinning 3D to Transforms is different than CSS Skinning 37
Skinning or Parenting Modeling Building Transform Skinning or Parenting! Demo of Simple Skinning Demo of Duke and Duke Bot 38
Modeling Building Transform Skinning or Parenting Demo of Key Poses and Graph Editor! 39
Program Agenda Backstory JavaFX 3D Overview JavaFX 3D Production Pipeline JavaFX 3D Data Pipeline Questions 40
JavaFX 3D Data Pipeline of Transforms Animated Skinned or Parented to Transforms Subdivision Surfaces 41
JavaFX 3D Data Pipeline of Transforms Animated Skinned or Parented Subdivision Surfaces 42
Comparing the Production and Data Pipelines Production Pipeline Modeling Building Transform Skinning or Parenting Data Pipeline of Transforms Animated Skinned or Parented Subdivision Surfaces 43
JavaFX 3D Data Pipeline of Transforms Animated Skinned or Parented Subdivision Surfaces 44
of Transforms Animated Skinned or Parented Subdivision Surfaces animated = new MayaImporter(); animated.load(composition.class.getresource ( resources/dukeanimated.ma ).toexternalform(), true); animated Duke = animated.getroot(); animatedtimeline = animated.gettimeline(); 45
of Transforms Animated Skinned or Parented Subdivision Surfaces interp = Interpolator.TANGENT(inDuration, intangentvalue, outduration, outtangentvalue); KeyValue keyvalue = new KeyValue(property, kv, interp); KeyFrame keyframe = new KeyFrame(time, keyvalue); Timeline timeline = new Timeline(Keyframe keyframes); 46
of Transforms Animated of Transforms Animated Skinned or Parented Subdivision Surfaces animatedtimeline.play(); When the timeline plays, properties are updated based on the interpolators, and transforms are animated. 47
Skinned (or Parented) of Transforms Animated Skinned or Parented Subdivision Surfaces public SkinningMesh(PolygonMesh mesh, float[][] weights, Affine[] bindtransforms, Affine bindglobaltransform, List<Joint> joints, List<Parent> jointforest); public void update(); 48
Subdivision Surfaces of Transforms Animated Skinned or Parented Subdivision Surfaces public SubdivisionMesh(PolygonMesh mesh, int subdivisionlevel, BoundaryMode boundarymode, MapBorderMode mapbordermode); public void update(); 49
Program Agenda Backstory JavaFX 3D Overview JavaFX 3D Production Pipeline JavaFX 3D Data Pipeline Questions 50
Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 51
52