File:Trilite.png

Summary

Description
English: A doubly-truncated cylinder, illuminated by 3 perpendicular spotlights. Inspired by File:Dualite.jpg. Also known as a "cork plug".
Date
Source Own work
Author Kostmo
PNG development
InfoField

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 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.
Category:CC-BY-3.0#Trilite.png
Category:Self-published work

Source code

// Author: Karl Ostmo
// Date: 09/05/2010
// Version: 1.2

#include "colors.inc"
#include "textures.inc"

#declare camera_pos = 7;
#declare point_lightsource_pos = 20;

#declare spotlight_distance = 60;

#declare wall_spacing = 3;
#declare object_radius = 0.75;

#declare object_right_edge = wall_spacing - object_radius;
#declare wedge_slope = 0.5;

#declare first_wedge_plane_z_intercept = wall_spacing - wedge_slope*object_right_edge;
#declare first_wedge_plane_distance = first_wedge_plane_z_intercept / sqrt(wedge_slope*wedge_slope + 1);

#declare second_wedge_plane_z_intercept = wall_spacing + wedge_slope*object_right_edge;
#declare second_wedge_plane_distance = second_wedge_plane_z_intercept / sqrt(wedge_slope*wedge_slope + 1);

camera {
	location camera_pos
	look_at	0
}

difference {
	intersection {

		cylinder {
			<wall_spacing - object_radius, wall_spacing, wall_spacing>, <wall_spacing + object_radius, wall_spacing, wall_spacing>, object_radius
		}

		plane {
			<-1, 0, 1/wedge_slope>, first_wedge_plane_distance
		}
	}

	plane {
		<1, 0, 1/wedge_slope>, second_wedge_plane_distance
	}

	pigment {
		Candy_Cane
		scale 0.25
	}
}

#declare planes = array[3] {x, y, z}

#declare lightsource_positions = array[3] {
	<spotlight_distance, wall_spacing, wall_spacing>,
	<wall_spacing, spotlight_distance, wall_spacing>,
	<wall_spacing, wall_spacing, spotlight_distance>
}

#declare lightsource_targets = array[3] {
	<0, wall_spacing, wall_spacing>,
	<wall_spacing, 0, wall_spacing>,
	<wall_spacing, wall_spacing, 0>
}

#declare lightsource_colors = array[3] {
	Red,
	Green,
	Blue
}

#declare Index = 0;
#while(Index < 3)

	light_source {
	    lightsource_positions[Index]
	    color White
	    spotlight
	    radius 1
	    falloff 2.5
	    point_at lightsource_targets[Index]
	}

	plane {
		planes[Index], 0
		pigment {
			lightsource_colors[Index]
		}
	}

	#declare Index = Index + 1;
#end

light_source {
	point_lightsource_pos
	color 0.4
}
Category:Axonometric projections Category:Images with Povray source code
Category:Axonometric projections Category:CC-BY-3.0 Category:Created with Persistence of Vision Category:Images with Povray source code Category:Self-published work