本文整理汇总了Java中com.threed.jpct.Object3D.build方法的典型用法代码示例。如果您正苦于以下问题:Java Object3D.build方法的具体用法?Java Object3D.build怎么用?Java Object3D.build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.threed.jpct.Object3D
的用法示例。
在下文中一共展示了Object3D.build方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: localloadModel
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
public Object3D localloadModel(String filename, float scale) throws IOException {
String file = "res/raw/" + filename;
InputStream stream = this.getClass().getClassLoader().getResourceAsStream(file);
System.out.println("The code is executed");
Object3D[] model = Loader.load3DS(stream, scale);
Object3D o3d = new Object3D(0);
Object3D temp = null;
for (int i = 0; i < model.length; i++) {
temp = model[i];
temp.setCenter(SimpleVector.ORIGIN);
temp.rotateX((float)( -.5*Math.PI));
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
o3d = Object3D.mergeObjects(o3d, temp);
o3d.build();
}
return o3d;
}
示例2: localloadModel
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
public Object3D localloadModel(String filename, float scale) throws IOException {
String file = "res/raw/" + filename;
InputStream stream = this.getClass().getClassLoader().getResourceAsStream(file);
System.out.println("File is executed");
Object3D[] model = Loader.load3DS(stream, scale);
Object3D o3d = new Object3D(0);
Object3D temp = null;
for (int i = 0; i < model.length; i++) {
temp = model[i];
temp.setCenter(SimpleVector.ORIGIN);
temp.rotateX((float)( -.5*Math.PI));
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
o3d = Object3D.mergeObjects(o3d, temp);
o3d.build();
}
return o3d;
}
示例3: loadModel
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
private Object3D loadModel(String filename, float scale){
InputStream stream = getResources().openRawResource(R.raw.monster);
Object3D[] model = Loader.load3DS(stream, scale);
Object3D o3d = new Object3D(0);
Object3D temp = null;
for (int i = 0; i < model.length; i++) {
temp = model[i];
temp.setCenter(SimpleVector.ORIGIN);
temp.rotateX((float)( -.5*Math.PI));
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
o3d = Object3D.mergeObjects(o3d, temp);
o3d.build();
}
return o3d;
}
示例4: JpctTest
import com.threed.jpct.Object3D; //导入方法依赖的package包/类
public JpctTest() throws Exception
{
jframe = new JFrame("Hello world");
jframe.setSize(800, 600);
jframe.setVisible(true);
jframe.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
world = new com.threed.jpct.World();
world.setAmbientLight(0, 255, 0);
Image img = ImageIO.read( getClass().getClassLoader().getResourceAsStream("Images/FullHeart.png") );
assert (img != null);
TextureManager.getInstance().addTexture("box", new Texture(img) );
int id = TextureManager.getInstance().getTextureID("box");
// Make a quad from (0,0) to (100, 100)
Object3D obj = new Object3D(128);
obj.addTriangle(new SimpleVector(0, 0, 0), 0, 0,
new SimpleVector(100, 0, 0), 1, 0,
new SimpleVector(0, 0, 100), 0, 1,
id);
obj.addTriangle(new SimpleVector(0, 0, 100), 0, 1,
new SimpleVector(100, 0, 0), 1, 0,
new SimpleVector(100, 0, 100), 1, 1,
id);
obj.setBaseTexture("box");
obj.setCulling(false);
obj.build();
world.addObject(obj);
world.setAmbientLight(255, 255, 255);
box = Primitives.getBox(2f, 2f);
box.setAdditionalColor(Color.red);
box.setLighting(Object3D.LIGHTING_NO_LIGHTS);
box.build();
world.addObject(box);
Vector3f eye = new Vector3f(50, -120, 100);
Vector3f target = new Vector3f(50, 0, 50);
// TODO: Make this work somehow
Matrix4f camMatrix = MatrixUtil.createLookAt(eye, target, new Vector3f(0, 1, 0));
Matrix ownLookAt = toJptcMatrix(camMatrix);
world.getCamera().setBack(ownLookAt);
world.getCamera().setPosition(eye.x, eye.y, eye.z);
world.getCamera().lookAt(new SimpleVector(target.x, target.y, target.z));
Matrix jptcLookAt = world.getCamera().getBack();
System.out.println(jptcLookAt);
}