summaryrefslogtreecommitdiffstats
path: root/dimension/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-09-18 11:26:35 -0400
committerTavian Barnes <tavianator@gmail.com>2011-09-18 11:26:35 -0400
commitca6ed9f1a186c79a17d03050d737b29f6f0edc94 (patch)
treeafc6d4708457e8b2daa6568c01e50a27df8ce947 /dimension/tests
parent5e13aa2d3c8a0ed11b061641eb0f6bc8b81a6f4c (diff)
downloaddimension-ca6ed9f1a186c79a17d03050d737b29f6f0edc94.tar.xz
Add .scale(), .translate(), and .rotate() methods to transformable objects.
Diffstat (limited to 'dimension/tests')
-rw-r--r--dimension/tests/demo.dmnsn22
1 files changed, 9 insertions, 13 deletions
diff --git a/dimension/tests/demo.dmnsn b/dimension/tests/demo.dmnsn
index fbf51da..331c2b4 100644
--- a/dimension/tests/demo.dmnsn
+++ b/dimension/tests/demo.dmnsn
@@ -20,7 +20,7 @@
# Camera
camera = PerspectiveCamera(location = (0, 0.25, -4),
look_at = 0)
-camera.transform(rotate(53*Y))
+camera.rotate(53*Y)
# Background
background = PigmentMap(
@@ -51,7 +51,7 @@ hollow_cube = Difference(
ior = 1.1,
),
)
- .transform(rotate(45*X)),
+ .rotate(45*X),
Sphere(
center = 0, radius = 1.25,
@@ -84,19 +84,15 @@ arrow = Union(
6/6: Red,
},
)
- .transform(scale(1, 2.75, 1))
- .transform(translate(-1.25*Y)),
+ .scale(1, 2.75, 1)
+ .translate(-1.25*Y),
)
torii = Union(
[
- Torus(major_radius = 0.15, minor_radius = 0.05)
- .transform(translate(-Y)),
-
+ Torus(major_radius = 0.15, minor_radius = 0.05).translate(-Y),
Torus(major_radius = 0.15, minor_radius = 0.05),
-
- Torus(major_radius = 0.15, minor_radius = 0.05)
- .transform(translate(Y)),
+ Torus(major_radius = 0.15, minor_radius = 0.05).translate(Y),
],
texture = Texture(
pigment = Blue,
@@ -104,7 +100,7 @@ torii = Union(
),
)
-spike = Union([arrow, torii]).transform(rotate(-45*X))
+spike = Union([arrow, torii]).rotate(-45*X)
strip_textures = [
Texture(pigment = Red),
@@ -122,7 +118,7 @@ for i in range(128):
b = c
c = a + Z
-strip = Union(strip_triangles).transform(translate(5, -2, -4))
+strip = Union(strip_triangles).translate(5, -2, -4)
ground = Plane(
normal = Y, distance = -2,
@@ -131,7 +127,7 @@ ground = Plane(
Checker(),
[
White,
- PigmentMap(Checker(), [Black, White]).transform(scale(1/3))
+ PigmentMap(Checker(), [Black, White]).scale(1/3)
],
),
)