Skip to content

Instantly share code, notes, and snippets.

@Gro-Tsen
Last active May 14, 2024 10:15
Show Gist options
  • Save Gro-Tsen/c3d68c801104ac11edea14de871ba4cc to your computer and use it in GitHub Desktop.
Save Gro-Tsen/c3d68c801104ac11edea14de871ba4cc to your computer and use it in GitHub Desktop.
PoV-ray illustration of the theorem of Desargues in 3D
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include "consts.inc"
#include "colors.inc"
#include "woods.inc"
#include "stones.inc"
#include "metals.inc"
#include "skies.inc"
// povray +Idesargues.pov final.ini -W800 -H800
// convert desargues.png -quality 98 ~/public_html/images/geom/desargues3d.jpg
// convert desargues.png -resize 300x300 -quality 98 ~/public_html/images/geom/desargues3d-small.jpg
global_settings {
photons { count 100000 }
assumed_gamma 1.0
}
// Memento: POV-Ray uses a left-handed coordinate system.
// Here, x points right, y points down and z points toward camera.
#declare camera_dist = 12;
camera {
location <0, 0, camera_dist>
sky <0, -1, 0>
right <image_width/image_height, 0, 0>
look_at <0,0,0>
angle 2*atan(2/camera_dist * image_width/image_height)*180/pi
}
sky_sphere {
S_Cloud2
rotate <0,0,180>
}
plane {
<0,-1,0>,-1.5
texture {
T_Stone15
scale 5
}
}
light_source {
<-2, -15, 30>
color White
}
#declare point_O = <0,-3/2,0>;
#declare point_A1 = <0, 38/65, 0>;
#declare point_B1 = <-10/15 / (1 + (77/30)/camera_dist), 16/15 / (1 + (77/30)/camera_dist), 77/30 / (1 + (77/30)/camera_dist)>;
#declare point_C1 = <-10/10, 2/10, 0>;
#declare point_A2 = <0, -1/4, 0>;
#declare point_B2 = <-300/884 / (1 + (1155/884)/camera_dist), -171/884 / (1 + (1155/884)/camera_dist), 1155/884 / (1 + (1155/884)/camera_dist)>;
#declare point_C2 = <-150/584, -621/584, 0>;
#declare point_U = <-1/2 / (1 + (77/20)/camera_dist), 3/2 / (1 + (77/20)/camera_dist), 77/20 / (1 + (77/20)/camera_dist)>;
#declare point_V = <3/10, 7/10, 0>;
#declare point_W = <3/2 / (1 + (-231/40)/camera_dist), -1/2 / (1 + (-231/40)/camera_dist), -231/40 / (1 + (-231/40)/camera_dist)>;
sphere {
// The point O
point_O, 0.05
texture {
pigment { color red 0 green 1 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point A₁
point_A1, 0.05
texture {
pigment { color red 1 green 0 blue 0.5 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point B₁
point_B1, 0.05
texture {
pigment { color red 1 green 0 blue 0.5 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point C₁
point_C1, 0.05
texture {
pigment { color red 1 green 0 blue 0.5 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point A₂
point_A2, 0.05
texture {
pigment { color red 1 green 0.5 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point B₂
point_B2, 0.05
texture {
pigment { color red 1 green 0.5 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point C₂
point_C2, 0.05
texture {
pigment { color red 1 green 0.5 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point U
point_U, 0.05
texture {
pigment { color red 0 green 0 blue 1 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point V
point_V, 0.05
texture {
pigment { color red 0 green 0 blue 1 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
sphere {
// The point W
point_W, 0.05
texture {
pigment { color red 0 green 0 blue 1 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_O, 5*point_A1-4*point_O, 0.01
texture {
pigment { color red 0 green 0.5 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_O, 5*point_B1-4*point_O, 0.01
texture {
pigment { color red 0 green 0.5 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_O, 5*point_C1-4*point_O, 0.01
texture {
pigment { color red 0 green 0.5 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_C1, point_U, 0.01
texture {
pigment { color red 0.5 green 0 blue 0.25 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_C1, point_V, 0.01
texture {
pigment { color red 0.5 green 0 blue 0.25 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_B1, point_W, 0.01
texture {
pigment { color red 0.5 green 0 blue 0.25 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_C2, point_U, 0.01
texture {
pigment { color red 0.5 green 0.25 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_C2, point_V, 0.01
texture {
pigment { color red 0.5 green 0.25 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
point_B2, point_W, 0.01
texture {
pigment { color red 0.5 green 0.25 blue 0 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
cylinder {
2*point_U-point_W, 101*point_W-100*point_U, 0.01
texture {
pigment { color red 0 green 0 blue 0.5 }
finish { ambient .45 diffuse .6 phong .3 }
}
}
triangle {
point_A1, point_B1, point_C1
texture {
pigment { color red 0.5 green 0 blue 0.25 transmit 0.2 }
finish { reflection { 0.1 } ambient .45 diffuse .6 phong .3 }
}
}
triangle {
point_A2, point_B2, point_C2
texture {
pigment { color red 0.5 green 0.5 blue 0.25 transmit 0.2 }
finish { reflection { 0.1 } ambient .45 diffuse .6 phong .3 }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment