JSR-184中纹理对象介绍[6]

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

本文简介:

Texture2D texture = new Texture2D (new Image2D (Image2D.RGB, texImg)); // 在表面重复纹理

texture.setWrapping (Texture2D.WRAP_REPEAT, Texture2D.WRAP_REPEAT);

// 设置混合模式.

texture.setBlending (Texture2D.FUNC_DECAL);

//设置过滤模式

texture.setFiltering(Texture2D.FILTER_NEAREST, Texture2D.FILTER_NEAREST);

纹理对象创建后,我们就要把它们添加到mesh的外观对象中。如果要移除某个纹理对象,只需要设置相应索引上的对象为null

// 添加第一个纹理对象

meshAppearance.setTexture(0,  brickTexture);

// 添加第二个纹理对象

meshAppearance.setTexture(1,  multiTexture);

//移除时

meshAppearance.setTexture(0,  null);

meshAppearance.setTexture(1,  null);

本文关键:JSR-184中纹理对象介绍
 

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

go top