Introduction to j23d Technology

Source: Internet
Author: User

3D technology is already very familiar to us. The most common 3D APIs include OpenGL and Microsoft Direct 3D, which have been widely used in desktop games. The emergence of Mobile 3D Graphics API (JSR184) makes it possible to add 3D functions to Mobile apps.
The JSR184 standard (M3G: Mobile 3D Graphics) defines a simple 3D API interface for Java Mobile applications. The j2's program can easily use M3G to implement 3D applications, such as games. M3G is designed to be very lightweight and the complete implementation of the entire API cannot exceed kb.
M3G is an optional package of j2_based OpenGL Lite version. There are 30 classes running on CLDC1.1/CLDC2.0 (floating point operations must be supported ), it can be used in MIDP1.0 and MIDP2.0. Currently, mobile phones supporting M3G include Nokia 6230/3650/7650/6600, Siemens S65/CX65/S55/M55, Sony-Ericsson K700i/P800/P900, And Moto 220/T720. M3G is just a Java interface, and the underlying 3D engine is generally implemented by C Code. For example, many mobile phone manufacturers use the Swerve engine of SuperScape, this is a high-performance 3D engine designed specifically for mobile devices.
Similar to Microsoft's D3D, M3G supports two 3D modes: instant mode and retained mode ). In the instant mode, developers must manually render each frame to get a fast speed, but the code is cumbersome. In the retain mode, developers only need to set the key frame, the remaining animations are completed by M3G, and the code is relatively simple, but the speed is slow. M3G also allows mixed use of these two modes.
3D models can be created in programs, but they are cumbersome. Therefore, M3G provides a Loader class that allows you to directly read all 3D scenarios from a single. m3g file. M3g files can be created through software such as 3D Studio Max.
If you are familiar with OpenGL, M3G is easy to understand. In M3G, Graphics3D is the screen interface for 3D rendering. World represents the entire 3D scenario, including Camera (used to set the observer's perspective), Light (Light), and Background (Background) and any number of 3D objects in the tree structure. 3D objects are described by Point, Pixel, Line, Polyline, and Spline in the computer. Specific storage and operations (such as rotation and projection) all are matrix operations and transformations.
SUN's WTK2.2 has a built-in M3G implementation package. If WTK2.2 is installed, you can run the 3D MIDP program on the simulator. See the sample demo3d in WTK2.2.
The following is the simplest M3G program from Sony-Ericsson's sample code. It creates a rotating pyramid where you can download the complete code and run it in WTK2.2.
First, we need to obtain a unique Graphics3D instance for rendering 3D scenes. Graphics3D is a Singleton implementation that can be obtained anywhere:
G3d = Graphics3D. getInstance ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.