📄 objects.inc
字号:
//// pedsim - A microscopic pedestrian simulation system. // Copyright (c) 2003 - 2004 by Christian Gloor// // You can redistribute and/or modify this program under the terms of// the GNU General Public License. See copying.txt for details.// // ----------------------------------------------------// Name: torch// Description: the thing some agent carry // Introduced: chgloor Sunday, January 11, 2004 14:41:36// ----------------------------------------------------#declare torch = //union { cylinder { <0,0,0>, <0,0.001,0>, 0.07 texture { pigment { color rgb<0.5,0.3,0.1> } } } /* light_source { <0, 1.1, 0> color rgb <1,0.8,0.3> fade_distance 10 fade_power 2 looks_like { union { sphere { <0,0,0>, 0.1 texture { pigment {color rgb <1, 0.8, 0.3>} finish {ambient 1 diffuse 1} }} sphere { <0,0.08,0>, 0.08 texture { pigment {color rgb <0.8, 0.7, 0.2>} finish {ambient 1 diffuse 1} } scale <1,2,1>} } } }*///}// ----------------------------------------------------// Name: banner// Description: the thing some agent carry // Introduced: chgloor Sunday, January 11, 2004 16:36:43// ----------------------------------------------------#include "stones.inc"#declare banner = union { cylinder { <0,0,0>, <0,4,0>, 0.05 texture { pigment { color rgb<0.4,0.3,0.0> } } } box { <0, 4, 0>, < 1, 3, 0.001> texture { T_Stone25 scale 4 } }} // ----------------------------------------------------// Name: head// Description: head of those guys // Introduced: chgloor Thursday, January 8, 2004 21:37:02// ----------------------------------------------------#declare head = union { sphere { <0,0,0> 0.3 texture { pigment { color rgb<0.5,0.5,0.5> } } } sphere { <.1,0,0> 0.3 texture { pigment { color rgb<0.3,0.2,0.1> } } } sphere { <-.27,.1,-.12> 0.07 texture { pigment { color rgb<0,0,0> } } } sphere { <-.27,.1, .12> 0.07 texture { pigment { color rgb<0,0,0> } } } }// ----------------------------------------------------// Name: sword// Description: sword: handle at 0,0,0 // Introduced: chgloor Thursday, January 8, 2004 21:37:19// ----------------------------------------------------//#declare sword = cylinder { <0,0,0>, <0,1,0>, 0.07 texture { pigment { color rgb<0.4,0.4,0.4> } } } #declare blade = difference{ #declare magicbox = box { <-.1,0,-.1> <.1,-3,.1> rotate 45*y} union { object {magicbox} intersection { object {magicbox translate -.5*x rotate 60*z} object {magicbox translate .5*x rotate -60*z} scale <.8,4,1> translate y*1.1 } intersection { object {magicbox translate <0,1,0> rotate 30*z} object {magicbox translate <0,1,0> rotate -30*z} object {magicbox} translate -3*y } } merge { sphere {< 0, -.5, sqrt(.08)/2> .08} sphere {< 0, -3, sqrt(.08)/2> .08} cylinder {< 0, -.5, sqrt(.08)/2> < 0, -3, sqrt(.08)/2> .08} sphere {< 0, -.5, -sqrt(.08)/2> .08} sphere {< 0, -3, -sqrt(.08)/2> .08} cylinder {< 0, -.5, -sqrt(.08)/2> < 0, -3, -sqrt(.08)/2> .08} } scale <1.3,1,.3> texture{pigment{color rgb .7} finish {reflection .8}}}#declare n = 4;#declare th = 180/n;#declare s = sin(radians(th))/(1+sin(radians(th)));#declare l = s/tan(radians(th));#declare h = sin(radians(th));#declare firstsplice = intersection{ cylinder { 0 .1*z 1 } //This is the large circle, of radius R, and R happens to equal 1 plane {y h} // This is the first planar cut, which is D units away from the center ^ plane {(-1*y) h} plane {(-1*x) (-1*l)}}#declare fourthsplice = difference{ object {firstsplice} //Commenting here would be redundant cylinder {<l,-s,-.1> <l,-s,.2> s-.00001} // The bottom circle...}#declare gms = merge{ object{fourthsplice} //Whew, all that work's paying off... cylinder{<l,s,0> <l,s,.1> s} // SHOULD be a mirror image of the bottom circle over x axis...}#declare counter = 0;#declare metaphysicmerge = merge { #while (n >= counter) object {gms rotate z*((360/n)*counter) } #declare counter = counter + 1; #end}#declare centerstar = intersection { cylinder {0 .1*z 1-s} difference { cylinder {-.1*z .2*z 1} object{ metaphysicmerge translate -.05*z scale <1,1,100> } }}#declare hilt = union{ union { cylinder {<0,0,0> <0,1.1,0> .12 scale <1,1,.3>} sphere {<0,1.1,0> .15} union { cylinder { 0 <-.7,-.2,0> .1 } cylinder { 0 <.7,-.2,0> .1 } sphere { <-.7,-.2,0> .13 } sphere { <.7,-.2,0> .13 } scale <1,1,.3> } texture {pigment {color rgb .4} finish {phong .3 reflection .3}} } object { centerstar scale sqrt(.08) scale <5,5,4> translate -.3*sqrt(.08)*.5*z texture{pigment{color rgb <0,0,.6>} finish {reflection .7}} } sphere {0 .2 texture{pigment{color rgb <0,.8,1>} finish {phong .3 reflection .5}} scale <1,1,.35>}}#declare sword = union{ object {hilt rotate <180,0,0>} object {blade scale <1,1.1,1> rotate <180,0,0>}// finish {phong 1 reflection 1} scale 0.4}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -