当前位置: 首页>>代码示例>>Java>>正文


Java Object3D.build方法代码示例

本文整理汇总了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;
   }
 
开发者ID:huberflores,项目名称:MeshOffloading,代码行数:23,代码来源:Model3D.java

示例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;
   }
 
开发者ID:huberflores,项目名称:MeshOffloading,代码行数:23,代码来源:Model3D.java

示例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;
  }
 
开发者ID:JA0L,项目名称:3DSModel-AR,代码行数:17,代码来源:MainActivity.java

示例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);
}
 
开发者ID:tectonicus,项目名称:tectonicus,代码行数:54,代码来源:JpctTest.java


注:本文中的com.threed.jpct.Object3D.build方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。