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

Java Light类代码示例

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

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



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

示例1: removeSceneFromWorld

import com.threed.jpct.Light; //导入依赖的package包/类
/**
 * Removes everything to the world. Reset camera pos/lookAt.
 */
public void removeSceneFromWorld() {
	if (!active)
		throw new RuntimeException(
				"Cannot remove scene! It has already been removed!");

	for (Object3D instance : instances) {
		world.removeObject(instance);
	}

	for (IActor actor : actors) {
		actor.removeFromWorld();
	}

	for (Light light : lights) {
		light.dispose();
	}

	world.getCamera().setPosition(0, 0, 0);
	world.getCamera().lookAt(new SimpleVector(0, 0, 1));

	active = false;
}
 
开发者ID:andresjesse,项目名称:jpctblend,代码行数:26,代码来源:JPCTBlendScene.java


示例2: addSceneToWorld

import com.threed.jpct.Light; //导入依赖的package包/类
/**
 * Adds everything to the world.
 */
public void addSceneToWorld() {
	if (active)
		throw new RuntimeException(
				"Cannot load Scene! it  already has been loaded!");

	for (Object3D instance : instances) {
		world.addObject(instance);
	}

	for (IActor actor : actors) {
		actor.addToWorld(world);
	}

	for (Light light : lights) {
		light.enable();
	}

	if (cameras.size() > 0) {
		CameraInfo currentCameraInfo = cameras.get(0);// For now '0' is the
														// default camera.

		world.getCamera().setPosition(currentCameraInfo.getPosition());
		world.getCamera().lookAt(currentCameraInfo.getLookAt());
		
		// FOV tip, by juan from JPCT forum.
		// http://www.jpct.net/forum2/index.php/topic,3711.0.html
		world.getCamera().setFOV(0.914f);
	}

	active = true;
}
 
开发者ID:andresjesse,项目名称:jpctblend,代码行数:35,代码来源:JPCTBlendScene.java


示例3: addToWorld

import com.threed.jpct.Light; //导入依赖的package包/类
public void addToWorld(World world) {
    mLight = new Light(world);
    setPosition(mPosition);
    setIntensity(mR, mG, mB);
    setVisibility(mVisible);
}
 
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:7,代码来源:TrackableLight.java


示例4: drawScene

import com.threed.jpct.Light; //导入依赖的package包/类
private void drawScene(){
	world = new World();

	Vector<EditorObject> objects = new Vector<EditorObject>();
	Vector<LightData> lights = new Vector<LightData>();

	
	String flagModeSetting = prefs.getString(Settings.FLAG_MODE_SETTING, Settings.FLAG_MODE_FULLSCREEN);
	String flagSpeedSetting = prefs.getString(Settings.FLAG_SPEED, "normal");
	
	AssetManager assetManager = FlagWallpaperService.context.getAssets();
	objects = Scene.loadSerializedLevel(flagModeSetting+"_"+flagSpeedSetting+".txt", objects, lights, null,null, world, assetManager);

	flag = (Scene.findObject(flagModeSetting+"0", objects));
	Animator.Play(flag, "wave", objects);

	float[] bb = flag.getMesh().getBoundingBox();
	float width = Math.abs(bb[0]-bb[1]);
	Camera cam = world.getCamera();
	float moveout;
	if(flagModeSetting.equals(Settings.FLAG_MODE_FULLSCREEN)){
		pole = null;
		moveout = 30; 
		cam.setPositionToCenter(flag);
		cam.moveCamera(Camera.CAMERA_MOVEOUT, moveout);
		//		cam.setYFOV(cam.convertRADAngleIntoFOV((float) Math.atan(height/(2*moveout))));
		cam.setFOV(cam.convertRADAngleIntoFOV((float) Math.atan(width/(2*moveout))));
		cam.lookAt(flag.getTransformedCenter());
	}else{
		pole = (Scene.findObject("pole", objects));
		float height = Math.abs(bb[2]-bb[3]);
		moveout = 35; 
		cam.setPosition(0, 0, 0);
		cam.moveCamera(Camera.CAMERA_MOVEOUT, moveout);
		cam.moveCamera(Camera.CAMERA_MOVEDOWN, height-5);
		cam.setFOV(cam.convertRADAngleIntoFOV((float) Math.atan(width/(2*moveout))));
		cam.lookAt(new SimpleVector(width/2, -height/2, 0));			
	}

	Light sun = new Light(world);
	SimpleVector sv = new SimpleVector();
	sv.set(flag.getTransformedCenter());
	sv.y += 100;
	sv.x -= 100;
	sv.z -= 30;
	sun.setPosition(sv);
	//		sun.disable();

	MemoryHelper.compact();

}
 
开发者ID:danilox6,项目名称:flag3dlivewallpaperbase,代码行数:52,代码来源:FlagRenderer.java


示例5: parseLights

import com.threed.jpct.Light; //导入依赖的package包/类
/**
 * Loads and add all lights to world
 * 
 * @param xmlLights
 *            xml lights root
 * @return
 */
private ArrayList<Light> parseLights(Node xmlLights) {
	ArrayList<Light> listLights = new ArrayList<Light>();

	NodeList childs = xmlLights.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("pointlight")) {

			Light light = new Light(world);

			light.setPosition(getAttrValueSimpleVector("position", node));

			SimpleVector intensity = getAttrValueSimpleVector("rgbcolor",
					node);
			intensity.scalarMul(getAttrValueFloat("distance", node) * 200f);// experimental
																			// param

			light.setIntensity(intensity);
			
			light.setAttenuation(getAttrValueFloat("distance", node) * 0.2f);// experimental
																				// param
			light.setDiscardDistance(getAttrValueFloat("distance", node) * 1.5f);// experimental
																					// param

			listLights.add(light);
		}

		if (node.getNodeType() == Node.ELEMENT_NODE
				&& node.getNodeName().equals("ambient")) {

			ambientLight = getAttrValueSimpleVector("rgbcolor", node);

			world.setAmbientLight((int) (ambientLight.x * 255),
					(int) (ambientLight.y * 255),
					(int) (ambientLight.z * 255));
		}
	}

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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