Professional Documents
Culture Documents
Laporan Uts
Laporan Uts
GRAFIKA KOMPUTER 2
DI SUSUN OLEH
PRODI INFORMATIKA
FAKULTAS TEKNIK
UNIVERSITAS MUHAMMADIYAH MAKASSAR
2022
/*
*/
package java6;
import javafx.animation.FadeTransition;
import javafx.animation.FillTransition;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.shape.Cylinder;
import javafx.scene.shape.CullFace;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Polygon;
import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.util.Duration;
/**
* @author ACER
*/
@Override
material1.setDiffuseColor(Color.WHITE);
cyl1.setHeight(150.0f);
cyl1.setRadius(30.0f);
cyl1.setTranslateX(150);
cyl1.setTranslateY(225);
cyl1.setMaterial(material1);
cyl2.setHeight(100.0f);
cyl2.setRadius(80.0f);
cyl2.setTranslateX(300);
cyl2.setTranslateY(250);
cyl2.setMaterial(material1);
cyl3.setHeight(150.0f);
cyl3.setRadius(30.0f);
cyl3.setTranslateX(450);
cyl3.setTranslateY(225);
cyl3.setMaterial(material1);
p1.getPoints().addAll(new Double[]{
100.0,150.0,
150.0,100.0,
200.0,150.0
});
p1.setFill(Color.GREEN);
p2.getPoints().addAll(new Double[]{
400.0,150.0,
450.0,100.0,
500.0,150.0
});
p2.setFill(Color.GREEN);
p3.getPoints().addAll(new Double[]{
210.0,200.0,
300.0,150.0,
390.0,200.0
});
p3.setFill(Color.GREEN);
r.setX(110);
r.setY(300);
r.setWidth(80.0);
r.setHeight(30.0);
r.setFill(Color.BLACK);
r1.setX(410);
r1.setY(300);
r1.setWidth(80.0);
r1.setHeight(30.0);
r1.setFill(Color.BLACK);
r2.setX(210);
r2.setY(300);
r2.setWidth(180.0);
r2.setHeight(30.0);
r2.setFill(Color.BLACK);
t.setText("\n_______________________"
+ "\n_______________________");
t.setFont(Font.font("verdana",FontWeight.BOLD, 25));
t.setFill(Color.BLACK);
t.setX(90);
t.setY(2);
fill.setCycleCount(1000);
fill.setDuration(Duration.millis(7000));
fill.setFromValue(Color.GREEN);
fill.setToValue(Color.AQUA);
fill.setShape(t);
fill.play();
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
/**
*/
launch(args);
HASIL