Programming | program J2ME 3D Programming--The first 3D program (with source code)
More articles please visit: Http://blog.csdn.net/mailbomb
Reference WTK2.2 provided the demo, completed the first 3D program, although very simple, and some problems are not very clear, or to share the code and is willing to learn J2ME 3D programming friends to study together.
About 3D programming information, you can check my blog.
A description of the compilation and operation of the code is as follows:
1. The following code is compiled and passed under J2ME WTK2.2.
2, the code is divided into two files: First3dcanvas.java and First3dmidlet.java.
3, the use of J2ME WTK2.2 to establish a new project, the main MIDlet class is: First3d. First3dmidlet
4, save the code in your engineering directory under the First3d directory.
5, will j2me WTK installation directory under the
The swerve.m3g files in the Apps\demo3d\res\com\superscape\m3g\wtksamples\retainedmode\content directory are copied to the Res directory under your engineering directory.
6. After your project is established, set up the project, through the WTK interface of the "Settings" button to open the Settings window, in "API Selection", set the "target platform" is: custom; "Profile" is "MIDP2.0"; "Configuration" is "CLDC1.1"; select "Mobile 3D Graphics For J2ME (JSR184) ".
7, so you can compile and run the following code.
The source code is as follows:
First3dmidlet.java
Package First3d;
Import javax.microedition.midlet.*;
Import javax.microedition.lcdui.*;
public class First3dmidlet extends MIDlet {
Private First3dcanvas displayable = new First3dcanvas ();
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.