OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [devs/] [watchdog/] [synth/] [v2_0/] [host/] [doghouse.pov] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
// A simple "doghouse" picture, used for the synthetic target
2
// watchdog device host-side.
3
//
4
// This file is normally built using the following command line:
5
//
6
// x-povray +Idoghouse.pov +W128 +H128 +D +Q9 +AM2 +A0.9 +FP
7
 
8
#include "consts.inc"
9
#include "colors.inc"
10
#include "shapes.inc"
11
#include "textures.inc"
12
#include "skies.inc"
13
#include "woods.inc"
14
 
15
camera {
16
    location <4.5, 2.2, -5>
17
    look_at <2, 2, 2>
18
}
19
 
20
light_source {
21
    <7, 4, -1.5>
22
    color White
23
}
24
 
25
sky_sphere { S_Cloud2 scale 2 }
26
background { colour LightBlue }
27
 
28
plane {
29
    y 0
30
    texture {
31
        pigment { color red 0.5 green 0.98 blue 0 turbulence 0.5}
32
        normal  { bumps 0.4 scale 0.1 }
33
    }
34
}
35
 
36
fog {
37
  distance   40
38
  fog_type   Ground_Fog
39
  fog_offset 1
40
  fog_alt    1
41
  colour     rgbf<0, 0.2, 0.2, 0.3>
42
  turbulence 0.2
43
}
44
 
45
// A plank is a 1x1x0.1 block with a corner at the origin. The edges are
46
// slightly rounded, to make sure that the plank boundaries are just
47
// about visible.
48
#declare Plank =
49
  superellipsoid { <0.03,0.03> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood10 } }
50
 
51
// A variant, for the roof
52
#declare RoofPlank =
53
  superellipsoid { <0.05,0.05> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood14 } }
54
 
55
// The front and back, a rectangle with a triangle on top.
56
// Going clockwise from the bottom left, the coordinates are:
57
//   <0,0> <0,3.2>, <2.4.5>, <4,3.2>, <4.0>
58
// Each is made from five horizontal planks.
59
//
60
// Note: this doghouse is not intended to be an example of good
61
// woodworking. For example, butt joints for the walls are a bad idea.
62
// Most importantly the roof should involve lapped joints with a
63
// sensible ridge, the current construction is not going to keep the
64
// rain out.
65
#declare RoofAngle = degrees(atan2(1.3,2));
66
#declare RoofAngleR = atan2(1.3,2);
67
 
68
#declare FrontBack =
69
  difference {
70
      union {
71
          object { Plank scale <4,1,1> translate <0,0,0> }
72
          object { Plank scale <4,1,1> translate <0,1,0> }
73
          object { Plank scale <4,1,1> translate <0,2,0> }
74
          object { Plank scale <4,1,1> translate <0,3,0> }
75
          object { Plank scale <4,1,1> translate <0,4,0> }
76
      }
77
      union {
78
          box { <0,0,0> <4,4,1> rotate <0,0,RoofAngle> translate <0,3.2,-0.5> }
79
          box { <0,0,0> <4,4,1> rotate <0,0, -1 * RoofAngle> translate <2,4.5,-0.5> }
80
          pigment { Black }
81
      }
82
  }
83
 
84
// The front also has some text to name the dog, and a
85
// cutout for the opening.
86
object {
87
    difference {
88
        object { FrontBack }
89
        union {
90
            text {
91
                ttf "cyrvetic.ttf" "FIFI" 0.1 0
92
                translate <1.2, 2.8, -0.05>
93
            }
94
            box { <1,0,-0.5> <3,2.2,0.5> }
95
            object {
96
                cylinder { <0,0,0> <0,0,1> 1 }
97
                scale <1,0.33,1>
98
                translate <2,2.2,-0.5>
99
            }
100
            pigment { Black }
101
        }
102
    }
103
}
104
 
105
// The back, nothing fancy needed here. The doghouse is twice
106
// as deep as it is wide.
107
object { FrontBack translate <0,0,8> }
108
 
109
// A floor, to prevent any bright grass showing inside
110
box { <0.05,0,0.05> <3.95,0.05,7.95> texture { T_Wood3 } }
111
 
112
// LHS
113
object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,0,0.1> }
114
object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,1,0.1> }
115
object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,2,0.1> }
116
 
117
// RHS
118
object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,0,0.1> }
119
object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,1,0.1> }
120
object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,2,0.1> }
121
 
122
// Now for the roof. The top of the roof is at <2,4.5,0>, and the
123
// corners are at <0,3.2,0> and <4,3.2,0>. The planks are 0.1 units
124
// thick.
125
 
126
#declare RoofPlank =
127
    superellipsoid { <0.05,0.05> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood14 } }
128
 
129
#declare RoofPlank_L = object {
130
    RoofPlank
131
    rotate <0, -90, RoofAngle - 90>
132
    scale<1,1,8.5>
133
}
134
 
135
#declare RoofPlank_R = object {
136
    RoofPlank
137
    rotate <0, -90, -90 - RoofAngle>
138
    scale<1,1,8.5>
139
}
140
 
141
object { RoofPlank_L translate<2 - (1 * cos(RoofAngleR)), 4.5 - (1 * sin(RoofAngleR)), -0.25> }
142
object { RoofPlank_L translate<2 - (2 * cos(RoofAngleR)), 4.5 - (2 * sin(RoofAngleR)), -0.25> }
143
object { RoofPlank_L translate<2 - (3 * cos(RoofAngleR)), 4.5 - (3 * sin(RoofAngleR)), -0.25> }
144
 
145
object { RoofPlank_R translate<2 + (-0.1 * cos(RoofAngleR)), 4.5 - (-0.1 * sin(RoofAngleR)), -0.25> }
146
object { RoofPlank_R translate<2 + (0.9 * cos(RoofAngleR)), 4.5 - (0.9 * sin(RoofAngleR)), -0.25> }
147
object { RoofPlank_R translate<2 + (1.9 * cos(RoofAngleR)), 4.5 - (1.9 * sin(RoofAngleR)), -0.25> }
148
 
149
// And just for fun, a dog bowl.
150
object {
151
    merge {
152
        difference {
153
            torus { 1.0 0.5 }
154
            box { <-1,-1,-1> <1,0,1> pigment { Black } }
155
        }
156
        cylinder { <0,0,0> <0,0.2,0> 0.9 }
157
    }
158
    scale <0.5,0.5,0.5>
159
    translate <-0.5,0,-0.7>
160
    pigment { Yellow }
161
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.