本文整理汇总了Java中com.threed.jpct.Object3D.rotateZ方法的典型用法代码示例。如果您正苦于以下问题:Java Object3D.rotateZ方法的具体用法?Java Object3D.rotateZ怎么用?Java Object3D.rotateZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.threed.jpct.Object3D
的用法示例。
在下文中一共展示了Object3D.rotateZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseInstances
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
/**
* Loads all meshs and add them to the MeshsManager. Also returns a a list
* of configured (pos/rot/scale/texture) Object3D's.
*
* @param xmlInstances
* instances root xml node
* @return all loaded instances as a strings list
*/
private ArrayList<Object3D> parseInstances(Node xmlInstances) {
ArrayList<Object3D> instancesList = new ArrayList<Object3D>();
NodeList childs = xmlInstances.getChildNodes();
for (int i = 0, len = childs.getLength(); i < len; i++) {
Node node = childs.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE
&& node.getNodeName().equals("instance")) {
String meshFile = getAttrValue("mesh_name", node) + ".3ds";
Object3D obj = null;
// If object not loaded: load and use, else: clone and use
if (!Object3DManager.getInstance().containsObject3D(meshFile)) {
// try to load resource from assets folder.
InputStream is = null;
try {
is = assets.open(sceneBasePath + "meshs"
+ File.separator + meshFile);
} catch (IOException e) {
e.printStackTrace();
}
// Configured blender to export one object per file, so
// loads just index [0]
obj = Loader.load3DS(is, 1.0f)[0];
Object3DManager.getInstance().putObject3D(meshFile, obj);
} else {
obj = Object3DManager.getInstance().cloneObject3D(meshFile);
}
obj.translate(getAttrValueSimpleVector("position", node));
SimpleVector rot = getAttrValueSimpleVector("rotation", node);
obj.rotateX(rot.x);
obj.rotateY(rot.y);
obj.rotateZ(rot.z);
// TODO: create scale method
// JPCT does not support 3 axis scale? :(
// disabled for now..
// obj.scale(getAttrValueSimpleVector("scale", node).x);
String textureName = getAttrValue("texture", node);
obj.setTexture(textureName);
//alpha to "png" textures
if (textureName.length() > 3) {
String ext = getAttrValue("texture", node).substring(
textureName.length() - 3, textureName.length());
if (ext.equals("png"))
obj.setTransparency(10);
}
instancesList.add(obj);
}
}
return instancesList;
}
示例2: parseInstances
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
/**
* Loads all meshs and add them to the MeshsManager. Also returns a a list
* of configured (pos/rot/scale/texture) Object3D's.
*
* @param xmlInstances
* instances root xml node
* @return all loaded instances as a strings list
*/
private ArrayList<Object3D> parseInstances(Node xmlInstances) {
ArrayList<Object3D> instancesList = new ArrayList<Object3D>();
NodeList childs = xmlInstances.getChildNodes();
for (int i = 0, len = childs.getLength(); i < len; i++) {
Node node = childs.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE
&& node.getNodeName().equals("instance")) {
String meshFile = getAttrValue("mesh_name", node) + ".3ds";
Object3D obj = null;
// Configured blender to export one object per file, so
// loads just index [0]
obj = Loader.load3DS(sceneBasePath + "meshs" + File.separator
+ meshFile, 1.0f)[0];
Object3DManager.getInstance().putObject3D(meshFile, obj);
obj.translate(getAttrValueSimpleVector("position", node));
SimpleVector rot = getAttrValueSimpleVector("rotation", node);
obj.rotateX(rot.x);
obj.rotateY(rot.y);
obj.rotateZ(rot.z);
// TODO: create scale method
// JPCT does not support 3 axis scale? :(
// disabled for now..
// obj.scale(getAttrValueSimpleVector("scale", node).x);
String textureName = getAttrValue("texture", node);
obj.setTexture(textureName);
//alpha to "png" textures
if (textureName.length() > 3) {
String ext = getAttrValue("texture", node).substring(
textureName.length() - 3, textureName.length());
if (ext.equals("png"))
obj.setTransparency(10);
}
instancesList.add(obj);
}
}
return instancesList;
}