• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Texture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.threed.jpct.Texture的典型用法代码示例。如果您正苦于以下问题:Java Texture类的具体用法?Java Texture怎么用?Java Texture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Texture类属于com.threed.jpct包,在下文中一共展示了Texture类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parseTextures

import com.threed.jpct.Texture; //导入依赖的package包/类
/**
 * Loads all textures and add them to the JPCT TextureManager. Also returns
 * a a list of textures (can be used to separe textures loaded by the user
 * and textures loaded by the JPCTBlend importer.
 * 
 * @param xmlTextures
 *            textures root xml node
 * @return all loaded textures as a strings list
 */
private ArrayList<String> parseTextures(Node xmlTextures) {
	ArrayList<String> listTextures = new ArrayList<String>();

	NodeList childs = xmlTextures.getChildNodes();

	for (int i = 0, len = childs.getLength(); i < len; i++) {
		Node node = childs.item(i);
		if (node.getNodeType() == Node.ELEMENT_NODE) {

			String txName = node.getNodeName();
			Texture newTx = new Texture(sceneBasePath + "textures"
					+ File.separator + txName);

			TextureManager.getInstance().addTexture(txName, newTx);
			listTextures.add(txName);
		}
	}

	return listTextures;
}
 
开发者ID:andresjesse,项目名称:jpctblend,代码行数:30,代码来源:JPCTBlendScene.java


示例2: getPlane

import com.threed.jpct.Texture; //导入依赖的package包/类
private Object3D getPlane() {
    Object3D object3D = Primitives.getPlane(2, 60);
    // Planes are rotated 180 degrees, so we need to flip them
    object3D.rotateX((float) Math.PI);
    // Load the AR Toolkit texture on top of the plane
    Texture texture = new Texture(getResources().getDrawable(R.drawable.artoolkit_logo));
    TextureManager.getInstance().addTexture("artoolkit", texture);

    object3D.setTexture("artoolkit");
    return object3D;
}
 
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:12,代码来源:ARSimple.java


示例3: loadUserBanckgroundTexture

import com.threed.jpct.Texture; //导入依赖的package包/类
private void loadUserBanckgroundTexture(String textname,Bitmap bitmap){
	if(TextureManager.getInstance().containsTexture(textname)){
		TextureManager.getInstance().unloadTexture(framebuffer, TextureManager.getInstance().getTexture(textname));
		TextureManager.getInstance().replaceTexture(textname, new Texture(bitmap,true));
	}else
		TextureManager.getInstance().addTexture(textname, new Texture(bitmap,true));
	bitmap.recycle();
}
 
开发者ID:danilox6,项目名称:flag3dlivewallpaperbase,代码行数:9,代码来源:FlagRenderer.java


示例4: loadTexture

import com.threed.jpct.Texture; //导入依赖的package包/类
private static void loadTexture(String textureName, Bitmap bitmap){
		if(!TextureManager.getInstance().containsTexture(textureName)){
			Log.i("FlagManager", "Loading texture: "+textureName +" "+bitmap.getHeight()+"x"+bitmap.getWidth()+ ", "+bitmap.getRowBytes()*bitmap.getHeight()+"bytes");
			Texture texture = new Texture(bitmap,true);
//			if(!textureName.equals(Settings.SKY_USER_BACKGROUND))
				texture.compress();
			TextureManager.getInstance().addTexture(textureName, texture);
			bitmap.recycle();
		}
	}
 
开发者ID:danilox6,项目名称:flag3dlivewallpaperbase,代码行数:11,代码来源:FlagManager.java


示例5: parseTextures

import com.threed.jpct.Texture; //导入依赖的package包/类
/**
 * Loads all textures and add them to the JPCT TextureManager. Also returns
 * a a list of textures (can be used to separe textures loaded by the user
 * and textures loaded by the JPCTBlend importer.
 * 
 * @param xmlTextures
 *            textures root xml node
 * @return all loaded textures as a strings list
 */
private ArrayList<String> parseTextures(Node xmlTextures) {
	ArrayList<String> listTextures = new ArrayList<String>();

	NodeList childs = xmlTextures.getChildNodes();

	for (int i = 0, len = childs.getLength(); i < len; i++) {
		Node node = childs.item(i);
		if (node.getNodeType() == Node.ELEMENT_NODE) {

			String txName = node.getNodeName();

			// try to load texture from assets folders
			InputStream is = null;
			try {
				is = assets.open(sceneBasePath + "textures"
						+ File.separator + txName);
				Log.d("jb", sceneBasePath + "textures" + File.separator
						+ txName);
			} catch (IOException e) {
				e.printStackTrace();
			}
			Log.d("jb", sceneBasePath + "textures" + File.separator
					+ txName);

			Texture newTx = new Texture(is);

			TextureManager.getInstance().addTexture(txName, newTx);
			listTextures.add(txName);
		}
	}

	return listTextures;
}
 
开发者ID:andresjesse,项目名称:jpctblend,代码行数:43,代码来源:JPCTBlendScene.java


示例6: RNGLModelViewRenderer

import com.threed.jpct.Texture; //导入依赖的package包/类
public RNGLModelViewRenderer(Context context) {
  Texture.defaultToMipmapping(true);
  Texture.defaultTo4bpp(true);
  mContext = context;
}
 
开发者ID:rastapasta,项目名称:react-native-gl-model-view,代码行数:6,代码来源:RNGLModelViewRenderer.java


示例7: setTexture

import com.threed.jpct.Texture; //导入依赖的package包/类
public void setTexture(Texture texture) {
  mTexture = texture;
}
 
开发者ID:rastapasta,项目名称:react-native-gl-model-view,代码行数:4,代码来源:RNGLModelViewRenderer.java


示例8: JpctTest

import com.threed.jpct.Texture; //导入依赖的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.Texture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XSSFPicture类代码示例发布时间:2022-05-22
下一篇:
Java MBeanExportException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap