Francesco Forcellato
This project allows to create solids and display them into whatever you want. This project was inspired by a project created by Daniel Shiffman in Processing but I have made it in the standard Java, so no extra Framework needed.
Installation:
If you only want the compiled code, in order to add this library to your Java project, download Engine3D.jar.
Note: in order to run the Example you must import Engine3D.jar in the libraries.
Engine.javaclass used to interact with aSolidand display it.Graph.javaclass used to create a graph of the connections in order to connect multiple nodes to each other.Matrix.javait contains all the methods used for managing matrices multiplications.Point.javaclass used to represent a 2D point.Point3D.javaclass used to represent a 3D point.Solid.javaclass used to create aSolid
To use this Java Library you must at least use an Engine object and a Solid object. The Engine controls the representation of the Solid, so you must create a Solid and add nodes to it, then you can add connections between the nodes.
To display the Solid you have to implement these methods in the Engine object:
- drawLine(double x0, double y0, double x1, double y1, Object drawer); which allows drawing a line between two points.
- beginPath(Object drawer); which allows beginning a path (requested from some components like GraphicsContext of JavaFX)
- closePath(Object drawer); which allows closing a path (requested form some components like GraphicsContext of JavaFX)
Thanks also to @davideporcu for helping me to realize this diagram.
- Create a solid by adding nodes and connections between them.
- Rotate a solid by X-axis, Y-axis, Z-axis.
- Display a solid by implementing the drawing functions.
- Added a project example using JavaFX.
- Change the location of the function
makeCube(double size), now it is in theSolidclass.
Check out develop branch to see the newest features in testing!