com.jme3.scene.Mesh.scaleTextureCoordinates()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中com.jme3.scene.Mesh.scaleTextureCoordinates()方法的一些代码示例,展示了Mesh.scaleTextureCoordinates()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mesh.scaleTextureCoordinates()方法的具体详情如下:
包路径:com.jme3.scene.Mesh
类名称:Mesh
方法名:scaleTextureCoordinates

Mesh.scaleTextureCoordinates介绍

[英]Scales the texture coordinate buffer on this mesh by the given scale factor.

Note that values above 1 will cause the texture to tile, while values below 1 will cause the texture to stretch.
[中]按给定的比例因子缩放此网格上的纹理坐标缓冲区。
请注意,大于1的值将导致纹理平铺,而小于1的值将导致纹理拉伸。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleInitApp() {
  cam.setLocation(new Vector3f(68.45442f, 8.235511f, 7.9676695f));
  cam.setRotation(new Quaternion(0.046916496f, -0.69500375f, 0.045538206f, 0.7160271f));
  flyCam.setMoveSpeed(50);
  Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
  Texture diff = assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg");
  diff.setWrap(Texture.WrapMode.Repeat);
  Texture norm = assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall_normal.jpg");
  norm.setWrap(Texture.WrapMode.Repeat);
  mat.setTexture("DiffuseMap", diff);
  mat.setTexture("NormalMap", norm);
  mat.setFloat("Shininess", 2.0f);
  AmbientLight al = new AmbientLight();
  al.setColor(new ColorRGBA(1.8f, 1.8f, 1.8f, 1.0f));
  rootNode.addLight(al);
  model = (Geometry) assetManager.loadModel("Models/Sponza/Sponza.j3o");
  model.getMesh().scaleTextureCoordinates(new Vector2f(2, 2));
  model.setMaterial(mat);
  rootNode.attachChild(model);
  FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
  SSAOFilter ssaoFilter = new SSAOFilter(2.9299974f,32.920483f,5.8100376f,0.091000035f);;
  ssaoFilter.setApproximateNormals(true);
  fpp.addFilter(ssaoFilter);
  SSAOUI ui = new SSAOUI(inputManager, ssaoFilter);
  viewPort.addProcessor(fpp);
}

代码示例来源:origin: jMonkeyEngine-Contributions/Lemur

m.scaleTextureCoordinates(new Vector2f(1/appliedTextureScale.x, 1/appliedTextureScale.y));
m.scaleTextureCoordinates(appliedTextureScale);

相关文章