本文整理汇总了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;未经允许,请勿转载。 |
请发表评论