Java ME & Blackberry APIs for Game Dev Week III. Overview Java 2D API Java 3D API SVG Blackberry APIs

Slides:



Advertisements
Similar presentations
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 2 2D Graphics: Basics.
Advertisements

Java3D Presented By Chris Gundlach
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Lecture21 Other Java Gamming technologies – Java3D (This lecture will not be assessed)
Lecture07 Graphics Programming in Java. Introduction Most of the graphics programming of java is done with: Most of the graphics programming of java is.
Introduction to SVG & Batik Presented by Shang-Ming Huang.
Chapter 4 Digital Multimedia, 2nd edition Vector Graphics.
Java 3D Pablo Figueroa University of Alberta April 2000.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
SWE 423: Multimedia Systems Chapter 4: Graphics and Images.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Vector vs. Bitmap SciVis V
V Obtained from a summer workshop in Guildford County July, 2014
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
Graphics: Creating Images Chapter 8, Exploring the Digital Domain.
Basic 3D Graphics Chapter 5. Bird’s Eye View  Basic 3D Graphics –Basic concepts of 3D graphics, rendering pipeline, Java 3D programming, scene graph,
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
1 Review of COMPSCI 221  Chapters 1-11 in text  User Interfaces will be addressed as a take- home question.
Macromedia Fireworks 8 Revealed WORKING WITH OBJECTS.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
© 2009 Research In Motion Limited Advanced Java Application Development for the BlackBerry Smartphone Trainer name Date.
1 Animation & Java3D ©Anthony Steed Overview n Introduction to Animation Kinematics Dynamics Boids n Java3D Scene graph Animation Vehicles.
Vector vs. Bitmap
Adobe Fireworks CS3 Revealed CHAPTER ONE: GETTING STARTED WITH ADOBE FIREWORKS.
2D Graphics: Rendering Details
A Simple Talk on Java 3D Presented by C.H. Chen on Jul. 6, 2004.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® INTRODUCTION TO FLASH ANIMATION.
® Copyright 2010 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH PROFESSIONAL CS5.
Advanced User Interfaces with Java SD’98 - Session 3206 Ted Faison Faison Computing Inc.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Class 02 – 03 Feb 2014 Setup Where do we begin? Know your content Discovering your target user.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 3 2D Graphics: Rendering Details.
1 Chapter 3 2D Graphics: Rendering Details  Color spaces, paints stroke types  Affine transforms including translation, rotation, scaling, shearing,
SVG for Designers Tom Hoferek. Objectives Introduce SVG Illustrate its capabilities Demonstrate SVG in action Speculate, discuss, answer questions.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
CS324e - Elements of Graphics and Visualization Java 3D Intro.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
INTRODUCTION GORT is a virtual 3D modeling environment for computer programmers. Its main area of focus is to aid in the education of programmers learning.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 4 Lecture 4 - Vector Graphics.
Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l.
In the name of God Computer Graphics.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
Adobe Fireworks CS3 Revealed CHAPTER TWO: WORKING WITH OBJECTS.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation.
Java Graphics Opening Discussion zWhat did we talk about last class? zDo you have any questions about the assignment? zOffset between class.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Chapter1 The flash interface and action script 3.0.
Guilford County SciVis V104.03
Advanced Java Screen Update Techniques SD’98 - Session 4406 Ted Faison Faison Computing Inc.
Mohammed AM Dwikat CIS Department Digital Image.
Georgia Institute of Technology Drawing in Java – part 2 Dr Usman Saeed Assistant Professor Faculty of Computing and Information Technology North Jeddah.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
Advanced AWT The Rendering Pipeline
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
12 Graphics and Java 2D™.
UofC Large Display Framework
Inserting and Working with Images
CSI-447: Multimedia Systems
Lecture Week 4 Images.
IMAGES.
Java Graphics The basic rendering mechanism is the drawing system that controls when and how programs can draw on a graphics component. When a component.
.NET and .NET Core 7. XAML Pan Wuming 2017.
(c) 2002 University of Wisconsin, CS 559
3D applications in Delphi
Introduction to Computer Graphics
Introduction to Computer Graphics
Chapter 49 Java 2D.
Direct2D Karolis Jodikaitis.
Presentation transcript:

Java ME & Blackberry APIs for Game Dev Week III

Overview Java 2D API Java 3D API SVG Blackberry APIs

Java 2D API Set of classes for advanced 2D graphics and imaging Encompasses –Line art –Text –Images Provides extensive support for –Image composition –Alpha channel images

Interfaces and Classes Java.awt - Interfaces –Composite Defines methods to compose a draw primitive with the underlying graphics area. –CompositeContext Defines the encapsulated and optimized environment for a composite operation –Paint Defines colors for a draw or fill operation

Interfaces and Classes (Cont.) Continued… –PaintContext Defines the optimized environment for a pain operation –Stroke Generates the Shape that encloses the outline of the Shape to be rendered.

Interfaces and Classes (Cont.) Java.awt Classes –AffineTransform (java.awt.geom) Represents a 2D affine transform, which performs a linear mapping from 2D coordinants to other 2D coordinants –AlphaComposite Implements basic alpha composite rules for shapes, text and images –BasicStroke Defines the “pen style” to be applied to the Shape –Color Defines a solid color fill for a Shape

Interfaces and Classes (Cont.) Continued –GradientPaint Defines a linear color gradient fill pattern for a Shape –Graphics2D Fundamental class for 2D rendering. –TexturePaint Defines a texture or pattern fill for a Shape.

2D Rendering Concepts To render a graphic object you must –Set up a Graphics2D context then –Pass the graphic object to one of the Graphics2D rendering methods

2D Rendering Concepts (Cont.) You can modify the state attributes to: –Vary the stroke width –Change how strokes are joined together –Set a clipping path to limit the rendered area –Translate, rotate, scale or shear rendered objects –Define colors and patterns to fill shapes with –Specify how multiple graphics objects should be composed.

Rendering Process Rendering process can be broken into 4 steps 1.If the shape is to be stroked, the Stroke attribute in the Graphics2D context is used to generate a new Shape that encompasses the stroked path 2.The coordinates of the Shape’s path are transformed from user space into device space according to the transform attribute in the Graphics2D context

Rendering Process (Cont.) 3.The Shape’s path is clipped using the clp attribute in the Graphics2D context 4.The remaining Shape, if any, is filled using the Paint and Composite attributes in the Graphics2D context

Controlling Rendering Quality 2D API lets you indicate whether you want objects to be rendered as quickly as possible Or quality rendering to be s high was possible Your preferences are specified as hints through the RenderingHints attribute in the Graphics2D context

Controlling Rendering Quality (Cont.) RenderingHints class supports the following types of hints: –Alpha interpolation – can be set to default, quality, or speed –Antialiasing – can be set to default, on or off –Color Rendering – can be set to default, quality, or speed –Dithering – can be set to default, disable or enable

Controlling Rendering Quality (Cont.) RenderingHints continued –Fractional Metrics – can be set to default on/off –Interpolation – can be set to nearest- neighbor, bilinear, or bicubic –Rendering – can be set to default, quality, or speed –Text antialiasing – can be set to default, on/off

Filling Attributes The fill attribute in the Graphics2D context is represented by a Pain object –Use setPaint to add Paint to the Graphics2D Simple solid color fills can be set with the setColor method. Color is the simplest implementation of the Paint interface

Filling Attributes (Cont.) To fill Shapes with more complex paint styles like gradients and textures, use Paint classes: –GradientPaint and TexturePaint When fill is called to render a shape: Determines what pixels comprise the Shape. Gets the color of each pixel from the Paint object. Converts the color to an appropriate pixel value for the output device. Writes the pixel to that device.

Transformations The Graphics2D context contains a transform that is used to transform objects from user space to device space during rendering To perform additional transformations, like rotations or scaling, add other transforms to the Graphics2D context Simplest transform ability is to call methods like: –Rotate- Scale –Shear- Translate

Transformations (Cont.) Other Abilities include –Transparency / Managing Transparency –Clipping –Specifying Composition Style

Java 3D API Is an application programming interface for writing 3- dimensional graphics applications Gives high-level constructs for –creating and manipulating 3D geometry –for constructing the structures used in rendering that geometry Part of JavaMedia suite API, making it “write once, run anywhere”

Java 3D API (Cont.) It draws the ideas from existing graphics APIs and from new technology. Java 3D’s low-level graphics constructs synthesize the best ideas found in low-level APIs such as Direct3D, QuickDraw3D, OpenGL, and XGL Java 3D introduces some concepts not commonly considered part of the graphics environment, ex 3D spatial sound

Rendering Modes Immediate Mode –Raised level of abstraction and accelerates immediate mode rendering on a per-object basis Retained Mode –Requires an application to construct a scene graph and specify which elements of that scene graph may change during rendering Compiled-Retained Mode –Like retained mode, additional the application can compile some or all of the subgraphs that make up a complete scene graph

High Performance Target Hardware Platforms –Aimed at a wide range of 3d-capable hardware and software platforms, from low to high end 3D image generators –3D implementations are expected to provide useful rendering rates on most modern PCs, on midrange PCs near full-speed hardware performance –Java 3D is designed to scale as the underlying hardware platforms increase in speed over time.

High Performance (Cont.) Layered Implementation –One of the more important factors that determines performance is the time it takes to render the visible geometry –Java 3D is layered to take advantage of native low- level API that is available on a given system –In particular, implementations use Direct3D and OpenGL are available.

Recipe for a Java 3D Program An example for the steps to create scene graph elements and link them together 1.Create a Canvas3D and add it 2.Create a BranchGroup as the root of the scene branch graph 3.Construct a Shape3D node with a TransformGroup node above it 4.Attach a RotationInterpolator behavior to the TransformGroup.

Recipe for a Java 3D Program (Cont.) 5.Call the simple universe utility function to do the following:  Establish a virtual universe with a single high-res Locale  Create PhysicalBody, PhysicalEnvironment, View, and ViewPlat-form objects  Create a BranchGroup s the root of the view platform branch graph  Insert the view platform branch graph into the Locale 6.Insert the scene branch graph into the simple universe’s Locale

Java 3D Application Scene Graph Below is a sample application The scene graph consists of a superstructure components-a VirtualUniverse object, a Locale object and a set of branch graphs. Each branch graph is a subgraph that is rooted by a BranchGroup node that is attached to the super structure.

Java 3D Object Hierarchy

SVG Scalable Vector Graphics SVG is a web format that allows content developers to create two dimensional graphics in a standard way, using XML grammar. Several authoring tools already support this format (such as Adobe Illustrator and Corel Draw)

SVG: Example SVG Hello World! Example <linearGradient id="the_gradient" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="0"> <text x="145" y="140" transform="translate(175,140) scale(4) skewX(30) translate(-175,-140)" font-size="24" font-family="ComicSansMS" fill="rgb(255,255,102)">Hello World!

SVG: Example The code would output an image like this:

Blackberry Important Objects used in creation –BitmapField –ButtonField –LabelField

Blackberry - Managers The following four classes extend the Manager class: –VerticalFieldManager –HorizontalFieldManager –FlowFieldManager –DialogFieldManager

References Java 2D API Java 3D API orDevelopers/J3D_1_2_API/j3dguide/Intro.doc.html Java AVG