Jump to content

File:Comparison oloid sphericon 3D.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 512 × 320 pixels, file size: 894 KB)

Summary

Description
English: Comparison of an oloid (left) and sphericon (right) rendered in POV-Ray by CMG Lee. Move your mouse pointer over the SVG image to rotate the shapes. The POV-Ray and Python code are embedded in the SVG file.
Source Own work
Author Cmglee

POV-Ray source code

comparison_oloid_sphericon_3D.pov comparison_oloid_sphericon_3D.ini
#declare CLOCK = clock;
//#declare CLOCK            = 1;
#declare BEARING          = int(CLOCK / 8) * 45;
#declare ELEVATION        = mod(CLOCK,  8) * 45;
#declare RADIUS           = 2;
#declare N_VERTEX         = 16;

plane { <0,1,0> 0 pigment { rgb<1,1,1> } translate<0,-4,0> }
/*
plane { <0,1,0> 0 pigment { checker <0.8,0.8,0.8> rgb<1,1,1> }
translate<0,-2,0> }
union { /// axes
 cone { <-1,0,0> 0.5 <1,0,0> 0.1 pigment { rgb <1,0,0> } }
 cone { <0,-1,0> 0.5 <0,1,0> 0.1 pigment { rgb <0,1,0> } }
 cone { <0,0,-1> 0.5 <0,0,1> 0.1 pigment { rgb <0,0,1> } }
 scale 2
}
*/
#declare HALF_SEPARATIONS = array[2]{0  , RADIUS / sqrt(2)};
#declare CENTROID_X       = array[2]{4, -2};

#local I = 0;
#while (I < 2)

 #local HALF_SEPARATION = HALF_SEPARATIONS[I];
 #if (HALF_SEPARATION = 0)
  #local ANGLE_MAX = pi / 2;
  #local PEAK_X    = 0;
 #else
  #local ANGLE_MAX = acos(-RADIUS / (RADIUS + 2 * HALF_SEPARATION));
  #local PEAK_X    = RADIUS * RADIUS / (RADIUS + 2 * HALF_SEPARATION)
- HALF_SEPARATION;
 #end

 #local EIGHTH =
 union {
  #local T = 0;
  #while (T < N_VERTEX)
   #local T = T + 1;
   #local ANGLE_T   =  T      / N_VERTEX * ANGLE_MAX;
   #local ANGLE_T_1 = (T - 1) / N_VERTEX * ANGLE_MAX;
   triangle {
    < HALF_SEPARATION + RADIUS * cos(ANGLE_T  ), 0, RADIUS * sin(ANGLE_T  )>,
    < HALF_SEPARATION + RADIUS * cos(ANGLE_T_1), 0, RADIUS * sin(ANGLE_T_1)>,
    < PEAK_X, RADIUS * sin(ANGLE_MAX), 0>
    #if (mod(T / N_VERTEX * 8, 3) > 1)
     pigment { rgb<0.9,0.7,0.5> }
    #else
     pigment { rgb<0.7,0.6,0.5> }
    #end
   }
  #end
 }

 #local HALF =
 union {
  object { EIGHTH }
  object { EIGHTH scale<1, 1,-1> }
  object { EIGHTH scale<1,-1, 1> }
  object { EIGHTH scale<1,-1,-1> }
 }

 union {
  object { HALF }
  object { HALF scale<-1,1,1> rotate<90,0,0> }
  rotate    <0        ,BEARING,0            >
  rotate    <0,0      ,ELEVATION            >
  translate <0        ,0      ,CENTROID_X[I]>
 }

 #local I = I + 1;
#end

camera {
 right     x * image_width / image_height
 location  <20,0,0>
 look_at   <0,0,0>
 angle     30 * image_width / image_height
}

union {
 light_source {
  <10,10,0> color 0.5
  area_light <0,3,0>, <0,0,1>, 3, 3
  adaptive 1 circular
 }
}
global_settings { ambient_light rgb <9,9,9> }
background { color rgb <0.9,0.9,0.9> }
; POV-Ray animation ini file
;Antialias=Off
Antialias=On
Antialias_Threshold=0.1
Antialias_Depth=2

Input_File_Name="oloid.pov"

Initial_Frame=0
Final_Frame  =63
Initial_Clock=0
Final_Clock  =63

Cyclic_Animation=off
Pause_when_Done=off
Debug_File=on

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

image/svg+xml

fa3c52fee7840c53a06576eba8af37f8a746431d

915,352 byte

320 pixel

512 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:05, 31 January 2016Thumbnail for version as of 21:05, 31 January 2016512 × 320 (894 KB)CmgleeFix background, padding and rotation direction.
11:19, 30 January 2016Thumbnail for version as of 11:19, 30 January 2016512 × 288 (894 KB)CmgleeAdd guides and zoom out.
00:35, 30 January 2016Thumbnail for version as of 00:35, 30 January 2016512 × 288 (891 KB)Cmglee{{Information |Description ={{en|1=Comparison of an oloid (left) and sphericon (right) rendered in POV-Ray by CMG Lee. Swipe over the SVG image to rotate the shapes. }} |Source ={{own}} |Author =Cmglee |Date...

Global file usage

The following other wikis use this file:

Metadata