In this article, we will focus on the first 3D program, which is based on the demo provided by WTK2.2, to complete the first 3D program. Although it is very simple, some problems are still unclear, we should also share the code and learn it together with our friends who are willing to learn the 3D programming of j2s.
J2_3d programming-the first 3D Program
Refer to the demo provided by WTK2.2 and complete the first 3D program. Although it is very simple and some problems are not very clear, we still need to share the Code with our friends who are willing to learn the 3D programming of j2s.
Code compilation and running are described as follows:
1. the following code is compiled in J2MEWTK2.2.
2. The code is divided into two files: First3DCanvas. java and First3DMIDlet. java.
3. Use J2MEWTK2.2 to create a new project. The main MIDlet class is first3d. First3DMIDlet.
4. Save the code to the first3d directory under your project directory.
5. Install
Copy the swerve. m3g file in the apps \ Demo3D \ res \ com \ superscape \ m3g \ wtksamples \ retainedmode \ content directory to the res directory under your project directory.
6. After your project is created, set the project and open the setting window through the "Settings" button on the WTK interface. In "API selection", set "Target Platform" to "Custom; "Profile" is "MIDP2.0", "configuration" is "CLDC1.1", and "mobile3dgraphicsforj2-jsr184)" is selected )".
7. You can compile and run the following code.