リビジョン 5775a464
| learn/java/javafx/Hello3d/Hello3d.java | ||
|---|---|---|
|
import javafx.scene.PerspectiveCamera;
|
||
|
import javafx.scene.PointLight;
|
||
|
import javafx.scene.Scene;
|
||
|
import javafx.scene.image.Image;
|
||
|
import javafx.scene.paint.Color;
|
||
|
import javafx.scene.paint.PhongMaterial;
|
||
|
import javafx.scene.shape.Sphere;
|
||
| ... | ... | |
|
|
||
|
public class Hello3d extends Application {
|
||
|
|
||
|
private final Image earthImage = new Image(getClass().getResourceAsStream("physical-free-world-map-b1.jpg"));
|
||
|
|
||
|
@Override
|
||
|
public void start(final Stage stage) {
|
||
|
final Group root = new Group();
|
||
| ... | ... | |
|
|
||
|
// 材質の定義
|
||
|
final PhongMaterial material = new PhongMaterial();
|
||
|
material.setDiffuseColor(Color.DODGERBLUE);
|
||
|
material.setSpecularColor(Color.DEEPSKYBLUE);
|
||
|
material.setDiffuseMap(earthImage);
|
||
|
earth.setMaterial(material);
|
||
|
|
||
|
// カメラの定義
|
||
地球画像をテクスチャマップとして貼り付け
あれ、アフリカがでっかく張り付いてしまってバランスがおかしいぞ!