vrml实例编程结课设计
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
description "Entry View"
}
Viewpoint {
position 0.0 1.65 15.0
orientation 1.0 0.0 0.0 0.5
description "Close-up"
}
Viewpoint {
position 7.05 1.65 7.05
orientation 0.0 1.0 0.0 0.785
diffuseColor 0.4 0.2 0.0
}
texture ImageTexture { url "wdoor.jpg" }
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.7 0.0 0.15,
0.7 0.0 0.15,
0.7 2.9 0.15,
material Material {
diffuseColor 0.6 0.4 0.0
}
}
geometry Cylinder {
radius 0.8
height 1.5
bottom FALSE
}
}
}
#
# First sail
#
DEF Sail Transform {
translation 0.0 3.5 0.1
ambientIntensity 0.3
diffuseColor 1.0 1.0 1.0
}
texture ImageTexture { url "swall1.jpg" }
textureTransform TextureTransform { scale 2.0 2.0 }
}
geometry CylBiblioteka Baidunder {
children USE Sail
}
]
}
DEF Clock TimeSensor {
cycleInterval 10.0
loop TRUE
startTime 1.0
stopTime 0.0
}
DEF Rotator OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
bottomRadius 6.0
height 4.0
}
}
}
#
# Windmill doorway
#
Transform {
translation 3.55 0.0 3.55
rotation 0.0 1.0 0.0 0.785
children [
#
# Doorway roof
#
Transform {
translation 0.0 3.6 0.0
textureTransform TextureTransform {
scale 2.0 6.0
}
}
geometry Box {
size 2.0 6.0 0.1
}
}
}
#
# Support for sail
#
Shape {
appearance USE Wood
geometry Box {
size 0.1 7.0 0.1
ambientIntensity 0.3
diffuseColor 0.8 0.0 0.0
}
texture ImageTexture { url "wtile.jpg" }
textureTransform TextureTransform { scale 4.0 4.0 }
}
geometry Cone {
translation 0.0 0.05 0.5
children Shape {
appearance Appearance {
material Material {
diffuseColor 0.4 0.4 0.4
}
}
geometry Box {
size 2.0 0.1 1.0
}
}
}
]
}
#
# Windmill sails (animated)
一个会动的风车模型
#VRML V2.0 utf8
WorldInfo {
title "Windmill"
info "Copyright (c) 1997, David R. Nadeau"
}
Viewpoint {
position 0.0 1.65 35.0
orientation 1.0 0.0 0.0 0.2
description "Front door"
}
Viewpoint {
position 35.0 1.65 -35.0
orientation 0.0 1.0 0.0 2.356
description "Far away"
}
Viewpoint {
position 0.0 14.43 2.0
orientation 0.00128 0.959 0.282 3.1503
radius 5.0
height 10.0
top FALSE
bottom FALSE
}
}
}
#
# Windmill roof
#
Transform {
translation 0.0 12.0 0.0
children Shape {
appearance DEF Tile Appearance {
material Material {
1.0 1.0,
0.0 1.0,
]
}
texCoordIndex [ 0, 1, 2, 3 ]
}
}
}
#
# Windmill tower
#
Transform {
translation 0.0 5.0 0.0
children Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 0.5 0.1
}
texture ImageTexture { url "fire_g.jpg" }
textureTransform TextureTransform { scale 2.0 2.0 }
}
geometry IndexedFaceSet {
coord Coordinate {
children Shape {
appearance USE Tile
geometry Cone {
bottomRadius 1.5
height 2.0
}
}
}
#
# Door
#
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.3
#
DEF Sails Transform {
translation 0.0 8.0 6.5
# rotation is animated to spin around the Z axis
children [
#
# Nauseating viewpoint
#
Viewpoint {
position 0.0 6.5 -0.1
point [
-100.0 0.0 100.0,
100.0 0.0 100.0,
100.0 0.0 -100.0,
-100.0 0.0 -100.0,
]
}
coordIndex [ 0, 1, 2, 3 ]
texCoord TextureCoordinate {
point [
0.0 0.0,
1.0 0.0,
}
}
]
}
#
# Other three sails
#
Transform {
rotation 0.0 0.0 1.0 1.571
children USE Sail
}
Transform {
rotation 0.0 0.0 1.0 -1.571
children USE Sail
}
Transform {
rotation 0.0 0.0 1.0 3.141
keyValue [
0.0 0.0 1.0 0.0,
0.0 0.0 1.0 3.141,
0.0 0.0 1.0 6.282
]
}
ROUTE Clock.fraction_changed TO Rotator.set_fraction
ROUTE Rotator.value_changed TO Sails.set_rotation
#orientation 0.0 1.0 0.0 1.571
description "On a sail"
}
#
# Shaft
#
Transform {
translation 0.0 0.0 -0.75
rotation 1.0 0.0 0.0 1.571
children Shape {
appearance DEF Wood Appearance {
-0.7 2.9 0.15,
-0.7 0.0 -0.05,
0.7 0.0 -0.05,
0.7 2.9 -0.05,
-0.7 2.9 -0.05,
]
}
coordIndex [
0, 1, 2, 3, -1,
4, 0, 3, 7, -1,
1, 5, 6, 2, -1,
]
texCoord TextureCoordinate {
children [
#
# Sail
#
Transform {
translation 0.0 1.0 0.1
children Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 1.0 1.0
}
texture ImageTexture { url "sails.jpg" }
speed 3.0
}
Background {
skyColor [
0.0 0.2 0.8,
0.1 0.3 0.9
0.7 0.7 0.7
]
skyAngle [
1.3,
1.471
]
}
#
# Light
#
DirectionalLight {
color 1.0 1.0 1.0
intensity 1.0
ambientIntensity 0.8
direction -1.0 -1.0 -1.0
}
#
# Ground
#
Transform {
translation 0.0 -0.005 0.0
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.7
point [
0.0 0.0,
1.0 0.0,
1.0 1.0,
0.0 1.0,
0.0 0.0,
0.08 0.0,
0.08 1.0,
0.0 1.0,
]
}
texCoordIndex [
0, 1, 2, 3, -1,
4, 5, 6, 7, -1,
4, 5, 6, 7, -1,
]
}
}
#
# Stair
#
Transform {
description "Roof top"
}
# One more viewpoint is below, inside the Transform for the
# windmill sails...
NavigationInfo {
type [ "WALK", "ANY" ]
headlight FALSE
}
Viewpoint {
position 0.0 1.65 15.0
orientation 1.0 0.0 0.0 0.5
description "Close-up"
}
Viewpoint {
position 7.05 1.65 7.05
orientation 0.0 1.0 0.0 0.785
diffuseColor 0.4 0.2 0.0
}
texture ImageTexture { url "wdoor.jpg" }
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.7 0.0 0.15,
0.7 0.0 0.15,
0.7 2.9 0.15,
material Material {
diffuseColor 0.6 0.4 0.0
}
}
geometry Cylinder {
radius 0.8
height 1.5
bottom FALSE
}
}
}
#
# First sail
#
DEF Sail Transform {
translation 0.0 3.5 0.1
ambientIntensity 0.3
diffuseColor 1.0 1.0 1.0
}
texture ImageTexture { url "swall1.jpg" }
textureTransform TextureTransform { scale 2.0 2.0 }
}
geometry CylBiblioteka Baidunder {
children USE Sail
}
]
}
DEF Clock TimeSensor {
cycleInterval 10.0
loop TRUE
startTime 1.0
stopTime 0.0
}
DEF Rotator OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
bottomRadius 6.0
height 4.0
}
}
}
#
# Windmill doorway
#
Transform {
translation 3.55 0.0 3.55
rotation 0.0 1.0 0.0 0.785
children [
#
# Doorway roof
#
Transform {
translation 0.0 3.6 0.0
textureTransform TextureTransform {
scale 2.0 6.0
}
}
geometry Box {
size 2.0 6.0 0.1
}
}
}
#
# Support for sail
#
Shape {
appearance USE Wood
geometry Box {
size 0.1 7.0 0.1
ambientIntensity 0.3
diffuseColor 0.8 0.0 0.0
}
texture ImageTexture { url "wtile.jpg" }
textureTransform TextureTransform { scale 4.0 4.0 }
}
geometry Cone {
translation 0.0 0.05 0.5
children Shape {
appearance Appearance {
material Material {
diffuseColor 0.4 0.4 0.4
}
}
geometry Box {
size 2.0 0.1 1.0
}
}
}
]
}
#
# Windmill sails (animated)
一个会动的风车模型
#VRML V2.0 utf8
WorldInfo {
title "Windmill"
info "Copyright (c) 1997, David R. Nadeau"
}
Viewpoint {
position 0.0 1.65 35.0
orientation 1.0 0.0 0.0 0.2
description "Front door"
}
Viewpoint {
position 35.0 1.65 -35.0
orientation 0.0 1.0 0.0 2.356
description "Far away"
}
Viewpoint {
position 0.0 14.43 2.0
orientation 0.00128 0.959 0.282 3.1503
radius 5.0
height 10.0
top FALSE
bottom FALSE
}
}
}
#
# Windmill roof
#
Transform {
translation 0.0 12.0 0.0
children Shape {
appearance DEF Tile Appearance {
material Material {
1.0 1.0,
0.0 1.0,
]
}
texCoordIndex [ 0, 1, 2, 3 ]
}
}
}
#
# Windmill tower
#
Transform {
translation 0.0 5.0 0.0
children Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 0.5 0.1
}
texture ImageTexture { url "fire_g.jpg" }
textureTransform TextureTransform { scale 2.0 2.0 }
}
geometry IndexedFaceSet {
coord Coordinate {
children Shape {
appearance USE Tile
geometry Cone {
bottomRadius 1.5
height 2.0
}
}
}
#
# Door
#
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.3
#
DEF Sails Transform {
translation 0.0 8.0 6.5
# rotation is animated to spin around the Z axis
children [
#
# Nauseating viewpoint
#
Viewpoint {
position 0.0 6.5 -0.1
point [
-100.0 0.0 100.0,
100.0 0.0 100.0,
100.0 0.0 -100.0,
-100.0 0.0 -100.0,
]
}
coordIndex [ 0, 1, 2, 3 ]
texCoord TextureCoordinate {
point [
0.0 0.0,
1.0 0.0,
}
}
]
}
#
# Other three sails
#
Transform {
rotation 0.0 0.0 1.0 1.571
children USE Sail
}
Transform {
rotation 0.0 0.0 1.0 -1.571
children USE Sail
}
Transform {
rotation 0.0 0.0 1.0 3.141
keyValue [
0.0 0.0 1.0 0.0,
0.0 0.0 1.0 3.141,
0.0 0.0 1.0 6.282
]
}
ROUTE Clock.fraction_changed TO Rotator.set_fraction
ROUTE Rotator.value_changed TO Sails.set_rotation
#orientation 0.0 1.0 0.0 1.571
description "On a sail"
}
#
# Shaft
#
Transform {
translation 0.0 0.0 -0.75
rotation 1.0 0.0 0.0 1.571
children Shape {
appearance DEF Wood Appearance {
-0.7 2.9 0.15,
-0.7 0.0 -0.05,
0.7 0.0 -0.05,
0.7 2.9 -0.05,
-0.7 2.9 -0.05,
]
}
coordIndex [
0, 1, 2, 3, -1,
4, 0, 3, 7, -1,
1, 5, 6, 2, -1,
]
texCoord TextureCoordinate {
children [
#
# Sail
#
Transform {
translation 0.0 1.0 0.1
children Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 1.0 1.0
}
texture ImageTexture { url "sails.jpg" }
speed 3.0
}
Background {
skyColor [
0.0 0.2 0.8,
0.1 0.3 0.9
0.7 0.7 0.7
]
skyAngle [
1.3,
1.471
]
}
#
# Light
#
DirectionalLight {
color 1.0 1.0 1.0
intensity 1.0
ambientIntensity 0.8
direction -1.0 -1.0 -1.0
}
#
# Ground
#
Transform {
translation 0.0 -0.005 0.0
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.7
point [
0.0 0.0,
1.0 0.0,
1.0 1.0,
0.0 1.0,
0.0 0.0,
0.08 0.0,
0.08 1.0,
0.0 1.0,
]
}
texCoordIndex [
0, 1, 2, 3, -1,
4, 5, 6, 7, -1,
4, 5, 6, 7, -1,
]
}
}
#
# Stair
#
Transform {
description "Roof top"
}
# One more viewpoint is below, inside the Transform for the
# windmill sails...
NavigationInfo {
type [ "WALK", "ANY" ]
headlight FALSE