Mar 27, 2024 16:52:59
Can some help me add better cubes to my 3d engine?
view on scratch
view on legacy ocular
10SmartGaming
loading
I don't know the specifics, but you would definitely use some trig.ok but how do I rotate that cube by the x y and z axis To create a cube, you need 6 faces. Each face is made up of either 1 quad or 2 triangles. For the sake of this example I will use quads.
At the very basics, a cube goes like this:
EXAMPLE P1(x, y, z), P2(x, y, z), P3(x, y, z) | P = Triangle Vertice
Tri 1: (0, 0, 0), (0, 1, 0) (1, 0, 0)
Tri 2: (1, 1, 0), (0, 1, 0) (1, 0, 0)
Tri 3: (0, 0, 0), (0, 1, 0), (0, 0, 1)
Tri 4: (0, 1, 1), (0, 1, 0), (0, 0, 1)
Tri 5: (1, 0, 0), (1, 1, 0), (1, 0, 1)
Tri 6: (1, 1, 1), (1, 1, 0), (1, 0, 1)
Tri 7: (0, 0, 1), (0, 1, 1) (1, 0, 1)
Tri 8: (1, 1, 1), (0, 1, 1) (1, 0, 1)
Tri 9: (0, 0, 0), (0, 0, 1) (1, 0, 0)
Tri 10: (1, 0, 1), (0, 0, 1) (1, 0, 0)
Tri 11: (0, 1, 0), (0, 1, 1) (1, 1, 0)
Tri 12: (1, 1, 1), (0, 1, 1) (1, 1, 0)
You can multiply every number by the desired size of the square