Introduction to jmonkeyengine. What is jmonkeyengine? A jme Application Scene graphs Coordinate systems



Similar documents
Java game programming. Game engines. Fayolle Pierre-Alain

Game Development in Android Disgruntled Rats LLC. Sean Godinez Brian Morgan Michael Boldischar

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Experiences with 2-D and 3-D Mathematical Plots on the Java Platform

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Chapter 6 - The Scene Graph

How To Teach Computer Graphics

Virtuelle Realität. Overview. Termin 9: Scene Graphs. Virtuelle Realität. Prof. Bernhard Jung

Equalizer. Parallel OpenGL Application Framework. Stefan Eilemann, Eyescale Software GmbH

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

Android Basics. Xin Yang

Programming 3D Applications with HTML5 and WebGL

VisIt Visualization Tool

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Chapter 6 - The Scene Graph

Computer Graphics 1. Chapter 4 (May 20th, 2010, 2-5pm): The scene graph. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Practical Data Visualization and Virtual Reality. Virtual Reality VR Software and Programming. Karljohan Lundin Palmerius

The Most Popular UI/Apps Framework For IVI on Linux

Introduction to Computer Graphics

Introduction to NaviGenie SDK Client API for Android

Making Dreams Come True: Global Illumination with Enlighten. Graham Hazel Senior Product Manager Sam Bugden Technical Artist

CS 4620 Practicum Programming Assignment 6 Animation

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Optimizing Unity Games for Mobile Platforms. Angelo Theodorou Software Engineer Unite 2013, 28 th -30 th August

CMSC 427 Computer Graphics Programming Assignment 1: Introduction to OpenGL and C++ Due Date: 11:59 PM, Sept. 15, 2015

MobiX3D: a player for displaying 3D content on mobile devices

Haptics Don t Lose Touch with Virtual Reality. Petr Kmoch Computer Graphics Group MFF UK

Ch 1: What is Game Programming Really Like? Ch 2: What s in a Game? Quiz #1 Discussion

GearVRf Developer Guide

CS 378: Computer Game Technology

INTERNSHIP REPORT CSC410. Shantanu Chaudhary 2010CS50295

Embedded Software development Process and Tools: Lesson-1

How To Understand The Power Of Unity 3D (Pro) And The Power Behind It (Pro/Pro)

How To Run A Factory I/O On A Microsoft Gpu 2.5 (Sdk) On A Computer Or Microsoft Powerbook 2.3 (Powerpoint) On An Android Computer Or Macbook 2 (Powerstation) On

Android Environment SDK

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Additional details >>> HERE <<<

Introduction to Android Development. Ed Burnette

Android and OpenGL. Android Smartphone Programming. Matthias Keil. University of Freiburg

Computer Graphics on Mobile Devices VL SS ECTS

Mondays and Thursdays, 10:05-11:25, F24-406

Example of Standard API

Digital 3D Animation

Practical Android Projects Lucas Jordan Pieter Greyling

Pitfalls of Object Oriented Programming

Modernizing Simulation Input Generation and Post-Simulation Data Visualization with Eclipse ICE

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

Optimizing AAA Games for Mobile Platforms

CURRICULUM VITAE EDUCATION:

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Running a Program on an AVD

Compositing a 3D character over video footage in Maya Jean-Marc Gauthier, Spring 2008

Beginning Android 4. Games Development. Mario Zechner. Robert Green

the gamedesigninitiative at cornell university Lecture 1 Course Overview

Geomagic Design. Release Notes. Get to Market Faster with Better Products at a Lower Cost V17

Developing Applications for ios

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Whitepaper. Trans. for Mobile

An Introduction to Android. Huang Xuguang Database Lab. Inha University

Finger Paint: Cross-platform Augmented Reality

Workshop on Android and Applications Development

Geant4 Visualization. Andrea Dotti April 19th, 2015 Geant4 M&C+SNA+MC 2015

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

CARS Configurable Automotive Research Simulator

System Structures. Services Interface Structure

Tutorial 9: Skeletal Animation

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

Research and Design of Universal and Open Software Development Platform for Digital Home

CPIT-285 Computer Graphics

Performance Optimization and Debug Tools for mobile games with PlayCanvas

The Car Tutorial Part 1 Creating a Racing Game for Unity

Project Management Case Study - A Strategic Perspective

Course: 3D Design Title: Deciduous Trees Blender: Version 2.6X Level: Beginning Author; Neal Hirsig (June 2012) Deciduous Trees

Rapid Game Development Using Cocos2D-JS

Full version is >>> HERE <<<

Lecture 1 Introduction to Android

JavaFX Session Agenda

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Creating and Using Databases for Android Applications


for Java developers Building Mobile Applications Introduction 1 Building Mobile Applications

OctaVis: A Simple and Efficient Multi-View Rendering System

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

How to develop your own app

SURVEYING WITH GPS. GPS has become a standard surveying technique in most surveying practices

C0600 Technical Report. Computer Animation in Java Emergent Behaviour in Autonomous Agents

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Full version is >>> HERE <<<

Lab 0 (Setting up your Development Environment) Week 1

Plug-in Software Developer Kit (SDK)

With a single download, the ADT Bundle includes everything you need to begin developing apps:

Cross-Platform Game Development Best practices learned from Marmalade, Unreal, Unity, etc.

Chapter 13: Program Development and Programming Languages

3D Client Software - Interactive, online and in real-time

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Java with Eclipse: Setup & Getting Started

Modern Graphics Engine Design. Sim Dietrich NVIDIA Corporation

Transcription:

Introduction to jmonkeyengine What is jmonkeyengine? A jme Application Scene graphs Coordinate systems

What is jmonkeyengine? jme is a game engine made for developers who want to create 3D games and other visualisation applications following modern technology standards Uses Java and is platform independent. Can deploy to Windows, Mac, Linux, Android and ios. OpenSource, non-profit, New BSD License

Features of jmonkeyengine Has integrated tools to make it easier to create games and applications Physics integration Special effects (pre/post processing, particles) Terrain-, Vegetation-, Water-systems++ Graphical User Interface Networking

Showcase http://www.youtube.com/watch? v=erc9fdin5da&feature=player_embedded http://jmonkeyengine.org/showcase/

Why use a high level API? Faster development process Not necessary to reinvent the wheel Provides abstraction from the low level: Think Objects. Not vertices Think content not rendering process. Not necessary to tell when to draw, just tell what to draw Retained mode This does not mean you do not need to understand what is going on underneath This is a programming course

What does jme do? Uses OpenGL, and features a modern shader based architecture (GLSL) Organises your scene with a scene graph data structure Transformations and mathematics jme performs rendering optimisations View frustum culling State sorting Batching jme is single threaded jme is NOT thread safe. Only modify the scenegraph from the rendering thread.

Applications of jme Games Education Scientific visualisation Information visualisation Geographic Information Systems (GIS) Computer-aided design(cad) Animation

Getting started Software: Java 6 or later Latest version of jme3 SDK LWJGL for communicating with OpenGL Latest version of graphics drivers Hardware: Hardware-accelerated graphics card required Must support OpenGL 2 or newer Must support GLSL (shader) Note: Do not use earlier versions of jme (< 3.0)

Getting started Documentation: Website: http://jmonkeyengine.org/ Wiki: http://wiki.jmonkeyengine.org/doku.php/jme3 Books: jmonkeyengine 3.0 Beginner s Guide jmonkeyengine 3.0 Cookbook

Development environment jme SDK Built on top of Netbeans IDE Aims to be similar to editor environments like the UDK Other IDE s Netbeans IntelliJ Eclipse Text editor + command line Use the IDE of your choice

A jme application

SimpleApplication The base for most jme applications Gives you access to standard game features such as scene graph (rootnode) an asset manager a user interface (guinode) input manager fly-by camera

SimpleApplication You should inherit from SimpleApplication You initialise your data by overriding public void simpleinitapp() You have to add your subgraph to the rootnode to make it visible Get a callback in the rendering thread by overriding public void simpleupdate(float tpf)

Hello World Hello3D.java

Bypassing SimpleApplication It is possible You lose functionality Only necessary if you have specific requirements You can unload everything added by SimpleApplication "Simple" means nothing more than necessary

Scene graphs What is a scene graph Scene graphs in jme

What is a scene graph A data structure containing all the data needed to render the scene More specifically it is a tree data structure Commonly used in 3D applications and vector based graphics

What is a scene graph jme renders the scene graph automatically to the screen If you want something visible, add it to the graph A scene graph is a transform hierarchy Two types of nodes: Group nodes Leaft nodes All nodes contains: Transform Parent (Children)

What is a scene graph Organize the scene logically and spatially Ease of operations such as transformation, visibility etc. Optimizations for picking, culling, etc.

What is a scene graph To outline a scene graph can help to clarify a design and ease the development of software Better performance with good organisation

Scene graphs in jme Every node in jme s scene graph is a Spatial Spatial contains: Transformation (more on this later) Parent (Node)

Scene graphs in jme Spatial is an abstract class Two classes inherit Spatial: Node and Geometry Geometry represent visible objects in the scene Mesh (geometry) and Material (rendering properties) Can only be children and leaf nodes Node is an invisible object, used for grouping objects Children (Spatials) Can be both parent and children

Scene graphs in jme Spatials also contain: List of Lights List of Controls (Behaviors) Other APIs might implement Light, Behaviors etc. as scene graph objects

Scene graphs in jme This is what the scene graph would look like in jme:

Scene graphs in jme We create nodes by instantiating jme classes Geometry planebody = new Geometry( planebody", planebodymesh ); Geometry leftwing = new Geometry( leftwing" ); We modify the nodes by using methods on an instance. leftwing.setmesh( wingmesh ); Build groups with nodes Node plane = new Node( plane ); plane.attachchild( planebody ); plane.attachchild( leftwing );...

Coordinate systems and transformations

Coordinate systems All spatials share a common world coordinate system A Spatial creates a new local coordinate system. This is relative to the parent Translation (position) sets the relative position Rotation sets the relative rotation Scale sets the relative size If you transform the parent system, all the children moves with it

Using the coordinate system Every part is built into their own local coordinate system

Using the coordinate system When these parts are assembled, this transposes the childrens shapes into the parents coordinate system

Using the coordinate system And so on, until we have built the plane

Transformations Every spatial has a Transform component The Transform represents the translation, rotation and scale of the spatial

Identity By using the method loadidentity(), the transform is set to Identity No translation in X, Y or Z No rotation A scale factor of 1 on X, Y and Z

Positioning in a coordinate system A vector moves the coordinate system Right-hand coordinate system A Vector3f holds the X,Y and Z distance

Translation example code Build the geometry Geometry geom = new Geometry("geom", mesh); To move the geometry +1.0f in the x-direction we need a Vector3f Vector3f trans = new Vector3f(1.0f, 0.0f,0.0f); This translation must be applied to the geometry geom.setlocaltranslation(trans);

Rotate a coordinate system Rotate around x,y or z and an axis Rotate around axis

Rotation, simple example Create the geometry Geometry geom = new Geometry("geom", mesh); Develop a 3D Transform for rotation around y- axis 45 degrees. Quaternion quat = new Quaternion( ); quat.fromanglenormalaxis((float)math.pi/4, Vector3f.UNIT_Y); Set the rotation to the geometry geom.setlocalrotation(quat);

Scaling a coordinate system By scaling we increase or decrease the size of a coordinate system and the shapes to the coordinate system Normal scale is 1.0f To scale equally much in x, y and z we can scale with a simple scale factor void setlocalscale ( float scale ); Or we can use individually scaling factors for each axis void setlocalscale (Vector3f scale);

Scaling, example code Create the geometry Geometry geom = new Geometry("geom", mesh); Create a Vector3f to scale with different values in the x.y and z axis Vector3f scale = new Vector3f(1.3f, 0.5f, 1.0f); Set the local scale for the geometry geom.setlocalscale(scale);

Modification of parts of transform Modification of parts of an existing transfom The other parts of the transform is untouched Is used to combine translation, rotation and scaling void settranslation(float x, float y, float z); void settranslation(vector3f trans); void setrotation(quaternion quat); void setscale(float scale); void setscale(vector3f scale);

Tranform points It is possible to transform points from one coordinate system to another Vector3f transformvector(vector3f in, Vector3f store) jme uses Vector3f to represent both points and vectors.

Hello Rotation HelloRotation.java