Header Sep
Mobile Java 3D Tips, Tricks & Code
 
My Rating Score
Login to rate page

August 2005
MascotWorld example: creating a world, adding objects and navigating

[Back]

 

This Mascot Capsule v3 example creates a 3D world compatible with all Sony Ericsson Mobile Java 3D-enabled mobile phones and was tested on the Sony Ericsson K750.

Download MascotWorld example>>

The MascotWorld example creates a big cube, built of smaller bricks that make up the cube's borders, as shown by the screenshots below. A net of stationary but rotating cubes is placed inside the world. On the same x and y plane, a car is placed and you can drive this car within this plane.

The user can navigate the world and control the camera or car using the mobile phone keypad, switching between controlling the camera or car with one of the phone's soft buttons. The world is transformed according to its own local coordinates using the following keypad controls:

  • arrow left/right: move left right
  • arrow  up/down: move in/out
  • keys 3/9: move up/down
  • keys 4/6: rotate left/right around the y-axis
  • keys 2/8: rotate up/down around the x-axis
  • keys 1/7: rotate clockwise and counter-clockwise around the z-axis
  • fire: place in center of the world, initial rotation

The user has limited control of car movement and when the car moves, the camera follows the same way. The car's movement is controlled by:

  • arrow left/right: turn left/right
  • arrow up/down: move forward/backward
  • keys 4/6: move left/right
  • fire: centers camera on top of car 

   

Please be aware, when analyzing this example, that the rotation of the world, or objects in it, changes local or world coordinates. The mobile phone keypad is not designed to handle such transformations. Therefore it may be tricky to figure out which key should be pressed to do which particular move or rotation.

To obtain specific behavior, consider and set the order of multiplication of the camera's affine transformations and key handling depending on the current situation. 

 

My Rating Score
Login to rate page