本文整理汇总了Java中com.threed.jpct.Object3D.rotateY方法的典型用法代码示例。如果您正苦于以下问题:Java Object3D.rotateY方法的具体用法?Java Object3D.rotateY怎么用?Java Object3D.rotateY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.threed.jpct.Object3D
的用法示例。
在下文中一共展示了Object3D.rotateY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateTrackableObjects
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
protected void populateTrackableObjects(List<TrackableObject3d> list) {
ARToolKit.getInstance().setPatternDetectionMode(NativeInterface.AR_MATRIX_CODE_DETECTION);
ARToolKit.getInstance().setMatrixCodeType(NativeInterface.AR_MATRIX_CODE_3x3);
TrackableObject3d tckobj = new TrackableObject3d("multi;Data/cubeMarkerConfig.dat");
Object3D object3D = Primitives.getCube(60);
object3D.setTransparency(10);
object3D.setTransparencyMode(Object3D.TRANSPARENCY_MODE_DEFAULT);
object3D.rotateY((float) Math.PI / 4);
object3D.setOrigin(new SimpleVector(0, 0, -60));
tckobj.addChild(object3D);
list.add(tckobj);
}
示例2: getCube
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
private Object3D getCube() {
int scale = 40;
Object3D object3D = Primitives.getCube(scale);
// Cubes in jpct are rotated by 45 degrees when created.
object3D.rotateY((float) Math.PI / 4);
object3D.setOrigin(new SimpleVector(0, 0, scale));
return object3D;
}
示例3: 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;
}
示例4: 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;
}