⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example7.java

📁 3D J2ME 代码集合
💻 JAVA
字号:

import javax.microedition.m3g.*;

/**
 * Light test.
 *
 * Scene consists of three balls and two lights. One of the lights
 * rotates around the balls. Highlights etc. should be visible.
 *
 */

public class Example7 extends ExampleBase
{
    private static final String FILE_NAME = "pallot";

    private Light iLight0;
    private World iWorld;

    public Example7()
    {
        super(SHOW_RENDER_TIME);
        iWorld = null;
    }

    protected void render(int time)
    {
        Transform transform = new Transform();
        transform.postRotate(((float)time)/10.f,
                            0.0f, 1.0f, 0.0f);   // rotate around this axis
        iLight0.setTransform(transform);
        Graphics3D.getInstance().render(iWorld);
    }

    protected void initialize()
    {
        iWorld = (World)load(FILE_NAME)[0];
        iLight0 = new Light();
        iLight0.setMode(Light.DIRECTIONAL);
        iWorld.addChild(iLight0);
        iWorld.align(null);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -