JavaFX Controls Preview

Thanks for the followup and taking the time to test it. I don’t know the answers to your questions, but will keep them in mind as we go forward. I’m impressed that you are able to run the code; did you use the technique of placing the jar files in the ‘code’ folder or were you able to use a re-compiled version of Processing4 by itself without a ‘code’ folder?

Found the following on the web:https://jenkov.com/tutorials/javafx/3d.html

Does this JavaFX 3D Example help any:

import javafx.application.Application;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene;
import javafx.scene.shape.Box;
import javafx.scene.shape.CullFace;
import javafx.scene.transform.Rotate;
import javafx.stage.Stage;

void setup() {
  size(1, 1, FX2D);
  Stage stage = new Stage();
  stage.setTitle("JavaFX 3D example");
  boolean is3DSupported = Platform.isSupported(ConditionalFeature.SCENE3D);
  if (!is3DSupported) {
    println("Sorry, 3D is not supported in JavaFX on this platform.");
    return;
  }
  Box box = new Box(100, 100, 100);
  box.setCullFace(CullFace.NONE);
  box.setTranslateX(250);
  box.setTranslateY(100);
  box.setTranslateZ(400);
  boolean fixedEyeAtCameraZero = false;
  PerspectiveCamera camera = new PerspectiveCamera(fixedEyeAtCameraZero);
  camera.setTranslateX(150);
  camera.setTranslateY(-100);
  camera.setTranslateZ(250);
  Group root = new Group(box);
  root.setRotationAxis(Rotate.X_AXIS);
  root.setRotate(30);
  Scene scene = new Scene(root, 500, 300, true);
  scene.setCamera(camera);
  stage.setScene(scene);
  stage.show();
}

Output:

1 Like