I was try to make a rubiks cube in javafx an ended up with a very bad model as given in the attatchment . I am giving my source for code for this, where I have used RectangleBuilder class to create rectangles and transformed in 3d. To fix the graphics i had also tried to build the rectangles used TriangleMesh class and after adding materials to them, transformed them in 3d to end up again in the same bad graphics. Why does this occur and how to get rid of it ? Here is my source code,
You have arrived in the wrong place; this forum is for discussing the forum itself. Never, mind, I can move you to the FX forum. I have also had to remove some excess code tags and break some of the long lines which made the code illegible. Please only use the code button to add tags and only around code.
Why have you got so many static fields?
What happens if you create only one cube object? What happens if you only create one side?
Thanks for editing my question properly and sorry for my mistakes.
The static fields before the handleMouse() method are used to get the current mouse position coordinates which are used in the handleMouse() method to rotate the perspective camera along the x and y axes with the dragging of the mouse so as to get the view of the cube from different angles.
If I display a single cube with the same colour on all the faces its fine, but as i use different colours on the 6 different faces the same problem arises.