Draw a sphere: Difference between revisions

Content added Content deleted
Line 3,303: Line 3,303:
[[image:PovRay-sphere.jpg]]
[[image:PovRay-sphere.jpg]]


=={{header|Processing}}==
=={{header|Java}}==
3D rendering is built into Processing.
3D rendering is built into Processing.


<lang Processing>void setup() {
<lang java>void setup() {
size(500, 500, P3D);
size(500, 500, P3D);
}
}
Line 3,320: Line 3,320:
}</lang>
}</lang>
A sphere build from triangles (to for instance allow distortion)
A sphere build from triangles (to for instance allow distortion)
<lang>float rotX, rotY;
<lang java>float rotX, rotY;


PVector[][] sphere;
PVector[][] sphere;