在JSR184中使用3D帖图[2]

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

本文简介:

texg3d.bindTarget(sceneTexture); // 绑定一个Image2D图形对象

texg3d.render(texWorld); // 渲染四棱锥到这个Image2D

 

g3d.bindTarget(g); // 绑定Graphics g3d

g3d.render(world); // 渲染该 world

 

帖图的长宽必须是2的指数 (2, 4, 8, 16 ? 256).

sceneTexture = new Image2D(Image2D.RGB, 64, 64);

使用这个Iamge2D作为帖图并且赋给多边形

现在使用我们刚刚生成的Image2D创建一个帖图;并且设置该帖图到平面的 appearance

Texture2D texture1 = new Texture2D(sceneTexture);

texture1.setBlending(Texture2D.FUNC_REPLACE);

texture1.setWrapping(Texture2D.WRAP_CLAMP, Texture2D.WRAP_CLAMP);

本文关键:在JSR184中使用3D帖图
  相关方案
Google
 

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

go top