Learn how to make real 3D games for Nokia Series 40 Asha phones using modern implementations of Mobile Java APIs. Presenter Michael Samarin of Futurice will start by introducing the details of the 3D game-making process: planning and building game levels; lighting and degree of realism; modelling tools vs. manual character creation; animations and behaviour of game objects; and balancing memory management against texture detail. You will learn game interface strategies including touch, touch-and-type, and keyboard only. Michael will share tips to optimize the performance of your games across different screen sizes and models of Series 40 phones. He’ll conclude with an overview of Mobile Java 3D performance on the latest range of Nokia Series 40 Asha phones.
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Getting Started with 3D Game Development on Nokia Series 40 Asha Phones
1. Series 40 Developer Training
Getting Started with 3D Game
Development on Nokia Series 40 Asha
Phones
Michael Samarin, Ph.D
Director,
Developer Training and Evangelism
Futurice Oy
2. Resurrect
Walking
Bring Interest to
Through 3D
Attention to Mobile Java
Brief Examples
Real 3D APIs 3D
JSR-184 with
on JSR-184
(M3G) NetBeans
Nokia (M3G)
Tour and Nokia
Series 40 For Game
SDK 1.1 for
(Asha) Making
Java
3. Series 40
› 675 Million Devices
› 3.9 Million Daily Downloads
› Price range 35 – 140 Euro
› Gaming Studios to compete with: EA, Gameloft, Rovio, India
Games
8. › Object-Oriented 3D
› Scene Graph based
› Optional MIDP JSR
Enter JSR-184 › Very compact API
› Very fast development
M3G › Optimized for small memory
and budget CPU
› Excellent implementation on
Series 40
10. Lightweight API, only 30 classes
AnimationController IndexBuffer RayIntersection
AnimationTrack KeyframeSequence SkinnedMesh
Appearance Light Sprite3D
Background Loader Texture2D
Camera Material Transform
CompositingMode Mesh Transformable
Fog MorphingMesh TriangleStripArray
Graphics3D Node VertexArray
Group Object3D VertexBuffer
Image2D PolygonMode World
11. › Immediate mode
› Similar to OpenGL ideology
› Retained mode
Modes › Scene Graph based
› Entire Scene Graph can be
restored from file
› Well defined M3G format
› Can be freely mixed
12. Scene Graph
Background Mesh
Group Morphing Mesh
World Skinned Mesh
Sprite 3D
Group
Sprite 3D User Object
Group Camera
Light
13. › World
› Background
› Morphing and Skinned Mesh
Most › Animated Geometry Objects
Interesting › Mesh
Scene Graph
Elements › 3D Geometry of Visible Object
› Sprite 3D
› 2D image in 3D space
14. public class SimpleWorld extends MIDlet {
Canvas3D canvas3D;
public void startApp() {
canvas3D = new Canvas3D();
Display.getDisplay(this).setCurrent(canvas3D);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
15. public class Canvas3D extends Canvas
implements Runnable {
public Canvas3D(){
}
public void paint(Graphics g) {
}
public void run() {
}
}
16. public class Canvas3D extends Canvas
implements Runnable {
private Thread thread;
public Canvas3D(){
private long startTime;
}
private Graphics3D graphics3D;
public void paint(Graphics g) {
private World world;
}
private Camera camera;
public void run() {
private boolean running = false;
}
}
17. setFullScreenMode(true);
thread = newThread(this);
public class Canvas3D extends Canvas
startTime= System.currentTimeMillis()
implements Runnable {
graphics3D= Graphics3D.getInstance();
public Canvas3D(){
world = new World();
}
camera = new Camera();
public void paint(Graphics g) {
floataspect = (float) getWidth()/ (float) getHeight();
}
camera.setPerspective(30.0f,aspect, 1.0f, 1000.0f);
public void run() { world.addChild(camera);
} world.setActiveCamera(camera);
} running = true;
thread.start();
18. public class Canvas3D extends Canvas
implements Runnable {
graphics3D.bindTarget(g);
public Canvas3D(){
world.animate(
}
(int)(System.currentTimeMillis() -
public void paint(Graphics g) { startTime));
} graphics3D.render(world);
public void run() { graphics3D.releaseTarget();
}
}
19. public class Canvas3D extends Canvas
implements Runnable {
public Canvas3D(){ while (running){
} repaint();
public void paint(Graphics g) { Thread.sleep(20);
} }
public void run() {
}
}
22. // Create vertex data.
VertexBuffer cubeVertexData = new VertexBuffer();
cubeVertexData.setDefaultColor(0x000000FF);
VertexArray vertexPositions =
new VertexArray(VERTEX_POSITIONS.length / 3, 3, 1);
vertexPositions.set(0, VERTEX_POSITIONS.length / 3,VERTEX_POSITIONS);
cubeVertexData.setPositions(vertexPositions, 1.0f, null);
// Create the triangles that define the cube; the indices point to
// vertices in VERTEX_POSITIONS.
TriangleStripArray cubeTriangles = new TriangleStripArray(
TRIANGLE_INDICES, new int[]{TRIANGLE_INDICES.length});
23. Material material = new Material();
material.setVertexColorTrackingEnable(true);
Appearance appearance = newAppearance();
appearance.setMaterial(material);
// Create a Mesh that represents the cube.
Mesh cubeMesh = new Mesh(cubeVertexData, cubeTriangles, appearance);
cubeMesh.setOrientation(20.0f, 1.0f, 2.0f, 3.0f);
cubeMesh.setUserID(1);
world.addChild(cubeMesh);