Filled Vector Cube with Java


Hagen + Java + 3D   Der Würfel als Formel
 

Rotation um die z-Achse:
x' = x * cos(Rotation_z) - y * sin(Rotation_z)
y' = x * sin(Rotation_z) + y * cos(Rotation_z)

Rotation um die x-Achse:
y' = y * cos(Rotation_x) - z * sin(Rotation_x)
z' = y * sin(Rotation_x) + z * cos(Rotation_x)

Rotation um die y-Achse:
z' = z * cos(Rotation_y) - x * sin(Rotation_y)
x' = z * sin(Rotation_y) + x * cos(Rotation_y)

Tricks   Ausblick
Das light-sourcing läuft über die z-Achse.   Wenn ich mal viel Zeit habe baue ich gouraud-shading
bzw. texture mapping ein.
Der Testcode steht. Aber ist leider viel zu langsam.
Das lustige an Java ist, daß texture-mapping exakt
gleich lange dauert wie das eigentlich simplere gouraud-shading,
obwohl einiges mehr gerechnet wird.
    zurück / back