本文整理汇总了Java中com.jme3.texture.Texture.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java Texture.setImage方法的具体用法?Java Texture.setImage怎么用?Java Texture.setImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.texture.Texture
的用法示例。
在下文中一共展示了Texture.setImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleInitApp
import com.jme3.texture.Texture; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
BitmapText txt = guiFont.createLabel("Left: HW Mips");
txt.setLocalTranslation(0, settings.getHeight() - txt.getLineHeight() * 4, 0);
guiNode.attachChild(txt);
txt = guiFont.createLabel("Right: AWT Mips");
txt.setLocalTranslation(0, settings.getHeight() - txt.getLineHeight() * 3, 0);
guiNode.attachChild(txt);
// create a simple plane/quad
Quad quadMesh = new Quad(1, 1);
quadMesh.updateGeometry(1, 1, false);
quadMesh.updateBound();
Geometry quad1 = new Geometry("Textured Quad", quadMesh);
Geometry quad2 = new Geometry("Textured Quad 2", quadMesh);
Texture tex = assetManager.loadTexture("Interface/Logo/Monkey.png");
tex.setMinFilter(Texture.MinFilter.Trilinear);
Texture texCustomMip = tex.clone();
Image imageCustomMip = texCustomMip.getImage().clone();
MipMapGenerator.generateMipMaps(imageCustomMip);
texCustomMip.setImage(imageCustomMip);
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat1.setTexture("ColorMap", tex);
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat2.setTexture("ColorMap", texCustomMip);
quad1.setMaterial(mat1);
// quad1.setLocalTranslation(1, 0, 0);
quad2.setMaterial(mat2);
quad2.setLocalTranslation(1, 0, 0);
rootNode.attachChild(quad1);
rootNode.attachChild(quad2);
}