第一个JSR-184 MIDlet[7]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

Appearance appearance = new Appearance (); // A set of component objects that define the rendering attributes of a Mesh

// 一个Appearance组件,它封装了多边形级别的特征

PolygonMode polygonMode = new PolygonMode ();

polygonMode.setPerspectiveCorrectionEnable (true);

// 通过使用CULL_NONE棱锥的所有面都会显示

polygonMode.setCulling (PolygonMode.CULL_NONE);

// 棱锥使用平滑的颜色渐变

polygonMode.setShading (PolygonMode.SHADE_SMOOTH);

appearance.setPolygonMode (polygonMode);

 

// 为3D对象设置外观(appearance)

mesh.setAppearance (0, appearance);

下面我们重点看一下本篇文章中建立3D对象(棱锥)的过程。

1.这一步比较简单,指定棱锥用到的五个点。

2.建立一个点序列的INDICES 数组,这个数组中包含了顶点的信息,其中0到4依次和第一步中建立的点1到点5对应,对应关系如右图。

本文关键:第一个JSR-184 MIDlet
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top