Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 7: Scaling Shapes

../ch07/07fig12b.gif
Figure 7.12b

A tree scaled up about a center point set at the base of the tree trunk. Compare with Figure 7.12a.

07fig12b.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
    # Ground
        Shape {
            appearance DEF White Appearance {
                material Material { }
            }
            geometry Box {
                size 12.0 0.1 12.0
            }
        },
    # Tree
        Transform {
            translation 0.0 1.0 0.0
            scale       1.0 2.0 1.0
            center      0.0 -1.0 0.0
            children [
            # Trunk
                Shape {
                    appearance USE White
                    geometry Cylinder {
                        radius 0.5
                        height 2.0
                    }
                },
            # Branches
                Transform {
                    translation 0.0 3.0 0.0
                    children Shape {
                        appearance USE White
                        geometry Cone {
                            bottomRadius 2.0
                            height 4.0
                        }
                    }
                }
            ]
        }
    ]
}