m3g note 3

m3g note 3

/////////////////////
    note 3
/////////////////////
1.绘制模式—–保留模式、立即模式
保留模式是一种基本模式,你可以用来绘制整个世界结点和所有照相机、灯光和网眼。这是最简单的绘制模式,不过你还是需要控制你的世界。立即模式是直接绘制组中的网眼和顶点数据。这个给你更多的控制权,每个绘画都提供一个变换矩阵,在重绘前变换这个对象。在立即模式,你可以绘制一个世界结点,提供一个转化矩阵让绘制方法调用,不过你得放弃世界结点的漂亮的效果,例如照相机、背景等。
2.Graphics3D
2.1 绑定
获得一个Graphics3D对象是简单的,你只需要调用Graphics3D.getInstance()方法。每个MIDlet只能获得一个Graphics3D对象,这就是为什么只能通过getInstance方法获得该对象。绑定使用bindTarget方法,同时还使用了一些其他方法,让我们看下面的例子:
//Here is our Graphics3D object Graphics3D
g3d = Graphics3D.getInstance();
// Bind to an image
Image img = Image.createImage("myImage.png");
Graphics g = img.getGraphics();
g3d.bindTarget(g);
// Bind to the main Graphics object
g3d.bindTarget(getGraphics());
// We can also supply rendering hints. Remember those? I talked about them at the beginning.
// This is done by using the other form of the bindTarget method.
// It takes a Graphics object to begin with, as always, and then it needs a boolean
// and an integer mask of hints.
// The boolean simply tells the Graphics3D object if it should use a depth buffer
// and you’ll probably always set it to ‘true’. Here is how we’ll use it to bind
// with our hints:
g3d.bindTarget(getGraphics(), true, RENDERING_HINTS);

One thought on “m3g note 3

  1. wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling
    wow power leveling -229240027538707

Leave a Reply

Your email address will not be published. Required fields are marked *