|
![](/i/fill.gif) |
This is the inc I should have used for the program I posted over in
binaries.utilities, but I didn't make it until I had finished the
program. (sigh all that work gone to waste ;(.
Oh well, anyway all the instructions are right inside the inc, any
comments, questions, abuse etc..... are most welcome.
//Axes by KillFile
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
#include "jewels.inc"
#include "gem.inc"
//Just declare a blade (single or double) a holder, and a haft, and a
gem if you want.
////////////////////////////////////////////////////////////////
declare Double_Blade =
//This union makes the enitire blade
union{
//this makes the blade
difference{
// create a sphere shape
sphere
{
<0, 1, 0> // center of sphere <X Y Z>
2 // radius of sphere
scale <1,1,.3> // <= Note: Spheres can become ellipses by uneven
scaling
}
//This creates the edge of the blade on one side
torus
{
2.05,
0.75
rotate 90*x
translate -.6*z
translate 1*y}
//This creates the edge of the blade on the other side
torus
{
2.05,
0.75
rotate 90*x
translate .6*z
translate 1*y}
//These two cylinders create the cutous from the blade so it's not just
a complete circle
cylinder
{
1*z, -1*z, 1
translate -.2*y
// open
}
cylinder
{
1*z, -1*z, 1
translate 2.2*y
// open
}}
scale .25*z}
//the blade ends here
////////////////////////////////////////////////////////////////
declare Holder =
//the holder for the haft
cylinder
{
.5*y, 1.5*y, .3
}
////////////////////////////////////////////////////////////////
declare Single_Blade =
//This union makes the enitire blade
union{
//this makes the blade
difference{
// create a sphere shape
sphere
{
<0, 1, 0> // center of sphere <X Y Z>
2 // radius of sphere
scale <1,1,.3> // <= Note: Spheres can become ellipses by uneven
scaling
}
//This creates the edge of the blade on one side
torus
{
2.05,
0.75
rotate 90*x
translate -.6*z
translate 1*y}
//This creates the edge of the blade on the other side
torus
{
2.05,
0.75
rotate 90*x
translate .6*z
translate 1*y}
//These two cylinders create the cutous from the blade so it's not just
a complete circle
cylinder
{
1*z, -1*z, 1
translate -.2*y
// open
}
cylinder
{
1*z, -1*z, 1
translate 2.2*y
}
box
{
<-1, -2, -1> // one corner position <X1 Y1 Z1>
< 1, 2, 1> // other corner position <X2 Y2 Z2>
translate 1*x
translate 1*y
}
scale .25*z}}
//the blade ends here
////////////////////////////////////////////////////////////////
//This is the declaration for the gem
#declare facets=union{
#declare facet=box
{
<-1, .8, -1> // one corner position <X1 Y1 Z1>
< 1, 1, 1> // other corner position <X2 Y2 Z2>
rotate 55*z
translate .35*y
}
object {facet}
object {facet rotate 90*y}
object {facet rotate 180*y}
object {facet rotate 270*y}
object {facet rotate 45*y}
object {facet rotate 135*y}
object {facet rotate 225*y}
object {facet rotate 315*y}
#declare facet2=box
{
<-1, .8, -1> // one corner position <X1 Y1 Z1>
< 1, 1, 1> // other corner position <X2 Y2 Z2>
rotate 40*z
translate .52*y
}
object {facet2}
object {facet2 rotate 90*y}
object {facet2 rotate 180*y}
object {facet2 rotate 270*y}
object {facet2 rotate 45*y}
object {facet2 rotate 135*y}
object {facet2 rotate 225*y}
object {facet2 rotate 315*y}
#declare facet3=box
{
<-1, .8, -1> // one corner position <X1 Y1 Z1>
< 1, 1, 1> // other corner position <X2 Y2 Z2>
rotate 15*z
translate .65*y
}
object {facet3}
object {facet3 rotate 90*y}
object {facet3 rotate 180*y}
object {facet3 rotate 270*y}
object {facet3 rotate 45*y}
object {facet3 rotate 135*y}
object {facet3 rotate 225*y}
object {facet3 rotate 315*y}
}
#declare GEM=difference{
difference{
// create a sphere shape
sphere
{
<0, 1, 0> // center of sphere <X Y Z>
0.5 // radius of sphere
}
object {facets}
object {facets rotate 15*y}}
// create a box that extends between the 2 specified points
box
{
<-1, -1, -1> // one corner position <X1 Y1 Z1>
< 1, 1, 1> // other corner position <X2 Y2 Z2>
translate .1*y
}
scale <.6,1,.6>
translate .4*y}
//The Gem Declaration End here
////////////////////////////////////////////////////////////////
declare Haft =
//This is the haft
union{
cylinder
{
-6*y, 1.5*y, .2
}
sphere {
<0,-6,0>,.2}}
Post a reply to this message
|
![](/i/fill.gif) |