本文整理汇总了Java中javafx.scene.PointLight类的典型用法代码示例。如果您正苦于以下问题:Java PointLight类的具体用法?Java PointLight怎么用?Java PointLight使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PointLight类属于javafx.scene包,在下文中一共展示了PointLight类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadCamera
import javafx.scene.PointLight; //导入依赖的package包/类
private void loadCamera(Scene scene) {
//initialize camera
camera = new PerspectiveCamera(true);
camera.setVerticalFieldOfView(RUN_JASON);
//setup camera transform for rotational support
cameraTransform.setTranslate(0, 0, 0);
cameraTransform.getChildren().add(camera);
camera.setNearClip(0.1);
camera.setFarClip(100000.0);
camera.setTranslateZ(-5000);
cameraTransform.ry.setAngle(0.0);
cameraTransform.rx.setAngle(-45.0);
//add a Point Light for better viewing of the grid coordinate system
PointLight light = new PointLight(Color.GAINSBORO);
cameraTransform.getChildren().add(light);
cameraTransform.getChildren().add(new AmbientLight(Color.WHITE));
light.setTranslateX(camera.getTranslateX());
light.setTranslateY(camera.getTranslateY());
light.setTranslateZ(camera.getTranslateZ());
//attach camera to scene
scene.setCamera(camera);
}
示例2: loadCamera
import javafx.scene.PointLight; //导入依赖的package包/类
private void loadCamera(Scene scene) {
//initialize camera
camera = new PerspectiveCamera(true);
camera.setVerticalFieldOfView(RUN_JASON);
//setup camera transform for rotational support
cameraTransform.setTranslate(0, 0, 0);
cameraTransform.getChildren().add(camera);
camera.setNearClip(0.1);
camera.setFarClip(100000.0);
camera.setTranslateZ(-5000);
cameraTransform.ry.setAngle(0.0);
cameraTransform.rx.setAngle(-45.0);
//add a Point Light for better viewing of the grid coordinate system
PointLight light = new PointLight(Color.GAINSBORO);
cameraTransform.getChildren().add(light);
cameraTransform.getChildren().add(new AmbientLight(Color.WHITE));
light.setTranslateX(camera.getTranslateX());
light.setTranslateY(camera.getTranslateY());
light.setTranslateZ(camera.getTranslateZ());
//attach camera to scene
scene.setCamera(camera);
}
示例3: getLight
import javafx.scene.PointLight; //导入依赖的package包/类
private Group getLight(Group grp) {
Group root;
pointLight = new PointLight(Color.ANTIQUEWHITE);
pointLight.setTranslateX(15);
pointLight.setTranslateY(-10 * SCALE);
pointLight.setTranslateZ(-100 * SCALE);
root = new Group(grp, pointLight);
root.setFocusTraversable(true);
return root;
}
示例4: buildGroup
import javafx.scene.PointLight; //导入依赖的package包/类
private static Group buildGroup() {
Group grp = new Group();
Sphere s = new Sphere();
Box b = new Box();
s.setScaleX(SCALE);
s.setScaleY(SCALE);
s.setScaleZ(SCALE);
s.setTranslateX(-130);
b.setScaleX(SCALE);
b.setScaleY(SCALE);
b.setScaleZ(SCALE);
b.setTranslateX(130);
PhongMaterial material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
s.setMaterial(material);
b.setMaterial(material);
PointLight pl = new PointLight(Color.AQUA);
pl.setTranslateZ(-1000);
Sphere lightBalance = new Sphere();
// lightBalance.setScaleX(0.1);
// lightBalance.setScaleX(0.1);
// lightBalance.setScaleX(0.1);
lightBalance.setTranslateZ(1000);
grp.getChildren().addAll(s, b,pl,lightBalance);
return grp;
}
示例5: getPoint
import javafx.scene.PointLight; //导入依赖的package包/类
public PointLight getPoint() {
return new GetAction<PointLight>() {
@Override
public void run(Object... os) throws Exception {
setResult(vl.getPoint());
}
}.dispatch(Root.ROOT.getEnvironment());
}
示例6: setupSceneInternals
import javafx.scene.PointLight; //导入依赖的package包/类
/**
* <p>
* Creates scene elements that aren't meant to be manipulated by the user
* (markers, camera, etc.)
* </p>
*/
protected void setupSceneInternals(Group parent) {
// Create scene plane for frame of reference.
Box box = new Box(1000, 0, 1000);
box.setMouseTransparent(true);
box.setDrawMode(DrawMode.LINE);
box.setMaterial(new PhongMaterial(Color.ANTIQUEWHITE));
AmbientLight ambientLight = new AmbientLight(Color.rgb(100, 100, 100));
PointLight light1 = new PointLight(Color.ANTIQUEWHITE);
light1.setMouseTransparent(true);
light1.setTranslateY(-350);
PointLight light2 = new PointLight(Color.ANTIQUEWHITE);
light2.setMouseTransparent(true);
light2.setTranslateZ(350);
PointLight light3 = new PointLight(Color.ANTIQUEWHITE);
light3.setMouseTransparent(true);
light3.setTranslateZ(-350);
PointLight light4 = new PointLight(Color.ANTIQUEWHITE);
light4.setMouseTransparent(true);
light4.setTranslateZ(350);
TransformGizmo gizmo = new TransformGizmo(1000);
gizmo.showHandles(false);
parent.getChildren().addAll(gizmo, box, light1, light2, light3, light4,
ambientLight);
}
示例7: setupSceneInternals
import javafx.scene.PointLight; //导入依赖的package包/类
@Override
protected void setupSceneInternals(Group parent) {
// Create scene plane for frame of reference.
plane = new Box(1000, 0, 1000);
plane.setMouseTransparent(true);
plane.setDrawMode(DrawMode.LINE);
plane.setMaterial(new PhongMaterial(Color.ANTIQUEWHITE));
AmbientLight ambientLight = new AmbientLight(Color.rgb(100, 100, 100));
PointLight light1 = new PointLight(Color.ANTIQUEWHITE);
light1.setMouseTransparent(true);
light1.setTranslateY(-350);
PointLight light2 = new PointLight(Color.ANTIQUEWHITE);
light2.setMouseTransparent(true);
light2.setTranslateZ(350);
PointLight light3 = new PointLight(Color.ANTIQUEWHITE);
light3.setMouseTransparent(true);
light3.setTranslateZ(-350);
PointLight light4 = new PointLight(Color.ANTIQUEWHITE);
light4.setMouseTransparent(true);
light4.setTranslateZ(350);
axes = new TransformGizmo(1000);
axes.showHandles(false);
parent.getChildren().addAll(axes, plane, light1, light2, light3, light4,
ambientLight);
}
示例8: setupSceneInternals
import javafx.scene.PointLight; //导入依赖的package包/类
/**
* <p>
* Creates scene elements that aren't meant to be manipulated by the user
* (markers, camera, etc.)
* </p>
*/
@Override
protected void setupSceneInternals(Group parent) {
// Create the ambient light
AmbientLight ambientLight = new AmbientLight(Color.rgb(100, 100, 100));
// Create the point lights
PointLight light1 = new PointLight(Color.ANTIQUEWHITE);
light1.setMouseTransparent(true);
light1.setTranslateY(-350);
PointLight light2 = new PointLight(Color.ANTIQUEWHITE);
light2.setMouseTransparent(true);
light2.setTranslateZ(350);
PointLight light3 = new PointLight(Color.ANTIQUEWHITE);
light3.setMouseTransparent(true);
light3.setTranslateZ(-350);
PointLight light4 = new PointLight(Color.ANTIQUEWHITE);
light4.setMouseTransparent(true);
light4.setTranslateZ(350);
// Create the background grid
gizmo = new AxisGridGizmo(SCALE);
// Add everything to the scene
parent.getChildren().addAll(gizmo, light1, light2, light3, light4,
ambientLight);
}
示例9: ShapeContainer
import javafx.scene.PointLight; //导入依赖的package包/类
public ShapeContainer(T shape) {
this.shape = shape;
this.material = new PhongMaterial();
this.emissive = new PointLight();
this.selfIllumination = new AmbientLight();
this.selfIllumination.getScope().add(ShapeContainer.this);
initialize();
}
示例10: QuaternionCamera
import javafx.scene.PointLight; //导入依赖的package包/类
public QuaternionCamera() {
super();
PointLight light = new PointLight(Color.WHITE);
getChildren().add(light);
lookAt(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
}
示例11: init
import javafx.scene.PointLight; //导入依赖的package包/类
private void init(){
buildAxes(axesSize, axesThickness);
buildPanels(axesSize);
buildGrids(axesSize, gridLineSpacing);
buildEventHandlers();
getChildren().add(scatterDataGroup); //Holds ScatterPlot data
if(selfLightEnabled) {
PointLight light = new PointLight(Color.WHITE);
getChildren().add(light);
}
setDepthTest(DepthTest.ENABLE);
}
示例12: testObject3D
import javafx.scene.PointLight; //导入依赖的package包/类
@Override
public Group testObject3D() {
Group group = new Group();
ClothMesh cloth = new ClothMesh();
cloth.setPerPointMass(10);
cloth.setBendStrength(0.5);
cloth.setStretchStrength(1.0);
cloth.setShearStrength(0.55);
cloth.setDrawMode(DrawMode.LINE);
cloth.setCullFace(CullFace.NONE);
// cloth.setDiffuseMap(new Image("https://kenai.com/attachments/wiki_images/duke/Duke3DprogressionSmall.jpg"));
cloth.setSpecularPower(5);
PointLight light2 = new PointLight(Color.GAINSBORO);
light2.setTranslateZ(-1500);
PointLight light3 = new PointLight(Color.AZURE);
light3.setTranslateZ(2500);
Group g = new Group();
g.getChildren().addAll(cloth, light2, light3);
group.getChildren().add(g);
group.setPickOnBounds(false);
cloth.startSimulation();
return group;
}
示例13: testGetPointLightAdjuster
import javafx.scene.PointLight; //导入依赖的package包/类
@Test
public void testGetPointLightAdjuster() {
Adjuster adjuster = Adjuster.getAdjuster(PointLight.class);
assertThat(adjuster, is(instanceOf(NodeAdjuster.class)));
assertThat(adjuster.getNodeClass(), is(sameInstance(Node.class)));
}
示例14: buildLights
import javafx.scene.PointLight; //导入依赖的package包/类
private void buildLights() {
AmbientLight ambientLight = new AmbientLight(Color.color(0.5, 0.5, 0.5));
// Since this is attached to root, X is right, Y is down, Z is back
PointLight light1 = new PointLight(Color.WHITE);
light1.setTranslateX(20); // right
light1.setTranslateY(-20); // up
light1.setTranslateZ(-20); // forward
PointLight light2 = new PointLight(Color.color(0.6, 0.6, 0.6));
light2.setTranslateX(-20); // left
light2.setTranslateY(-20); // up
// light2.setTranslateZ(-20); // forward
// PointLight light3 = new PointLight(Color.color(0.3, 0.3, 0.3));
// light3.setTranslateY(20); // bottom
root.getChildren().addAll(ambientLight, light1, light2);
}
示例15: start
import javafx.scene.PointLight; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
camera = new PerspectiveCamera(true);
// setup camera transform for rotational support
camera.setNearClip(0.1);
camera.setFarClip(10000.0);
camera.setTranslateZ(-20);
makeYUp(camera);
cameraTransform.setTranslate(0, 0, 0);
cameraTransform.getChildren().add(camera);
// cameraTransform.ry.setAngle(-45.0);
// cameraTransform.rx.setAngle(-10.0);
// add a Point Light for better viewing of the grid coordinate system
PointLight point = new PointLight(Color.LIGHTSTEELBLUE);
AmbientLight ambient = new AmbientLight(Color.LIGHTSKYBLUE);
cameraTransform.getChildren().addAll(point, ambient);
point.setTranslateX(camera.getTranslateX());
point.setTranslateY(camera.getTranslateY());
point.setTranslateZ(camera.getTranslateZ());
Group group = new Group(cameraTransform);
Group sceneRoot = new Group(group);
Scene scene = new Scene(sceneRoot, sceneWidth, sceneHeight, true, SceneAntialiasing.BALANCED);
this.pointLight = point;
this.ambientLight = ambient;
configSceneColor(scene, point, ambient, cameraTransform);
scene.setCamera(camera);
makeObjects(group);
setActions(scene);
lastEffect = System.nanoTime();
AnimationTimer timerEffect = makeAnimation();
stage.setScene(scene);
stage.show();
timerEffect.start();
}