rss
twitter
facebook

Home

Mostrar mensagens com a etiqueta VRML - Computer Graphics. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta VRML - Computer Graphics. Mostrar todas as mensagens

VRML - with child - shapes

#VRML V2.0 utf8
#Copyright DM
Shape
{
geometry Box
{
size 2 2 2
}

appearance Appearance
{
material Material
{
diffuseColor 0.1 1.92 1.99
specularColor 0,31,36
ambientIntensity .0533
shininess .32
}
}
}


Transform
{
translation 0 2 0
children

Shape
{
geometry Cylinder
{
radius 1
height 2
side TRUE
bottom TRUE
top TRUE
}

appearance Appearance
{
material Material
{
diffuseColor 0.44 1.44 1.44
specularColor .1 .1 .1
ambientIntensity .117
shininess .4
}
}

}
}

Transform
{
translation 3 0 1
children

Shape
{
geometry Cylinder
{
radius 1
height 2
side TRUE
bottom TRUE
top TRUE
}
appearance Appearance
{
material Material
{
diffuseColor 0.1 .52 1.09
specularColor .92 .43 .01
ambientIntensity .45
shininess .4
}
}

}
}

Transform
{
translation 3 3 1
children


Shape
{

geometry Cone
{
bottom TRUE
}
appearance Appearance
{
material Material
{
diffuseColor 123 .133 .22
specularColor 31 .39 .39
ambientIntensity .07
shininess .13

}
}



}
}
Transform
{
translation 3 2 1
children


Shape
{
appearance Appearance
{
material Material
{
diffuseColor 0.44 1.44 1.44
specularColor 31 .39 .39
ambientIntensity .07
shininess .13

}
}
geometry Sphere
{
radius .6

}


}
}


Background
{
groundColor [.51 0.33 0.32
.42 0.15 0.23

.74 0.81 0.53]

skyColor [0.71 0.71 0.71
0.11 0.11 0.11

0.55 0.55 0.55]

skyAngle [1.309,1.709]

}



Shape
{
appearance DEF theTexture Appearance
{
texture ImageTexture
{
url ["http://www.cs.iupui.edu/~aharris/mm/texture/brick1.jpg"]
} # end texture
} # end appearance

geometry Box
{
size 1 2 3
} # end geometry
} # end shape

NavigationInfo
{
type "EXAMINE"
} # end navInfo

Read More

Computer Graphics

WorldInfo {
title "Bouncing beachball (JavaScript)"
info [ "Copyright (c) 1997, David R. Nadeau" ]
}

Viewpoint {
position 0.0 0.6 8.0
orientation 1.0 0.0 0.0 0.1
}

NavigationInfo {
type [ "WALK", "ANY" ]
headlight FALSE
speed 2.0
}

DirectionalLight {
ambientIntensity 0.5
direction 0.0 -1.0 -0.5
}

#
# Sky
#
Background {
skyColor [
0.0 0.0 1.0,
0.0 0.5 1.0,
0.7 0.7 1.0,
]
skyAngle [
1.371,
1.571,
]
}



#
# Beach
#
Shape {
appearance Appearance {
material Material { }
texture ImageTexture { url "sand.jpg" }
textureTransform TextureTransform { scale 10.0 10.0 }
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-50.0 -1.0 50.0,
50.0 -1.0 50.0,
50.0 -1.0 -50.0,
-50.0 -1.0 -50.0,
]
}
coordIndex [ 0, 1, 2, 3 ]
solid FALSE
}
}

#
# Palm trees
#
Transform {
translation -3.0 -1.0 -10.0
children [
DEF Palm Group {
children [
# Palm tree - in a billboard so it is never edge-on
Billboard {
children [
Shape {
appearance Appearance {
material NULL # emissive texturing
texture ImageTexture { url "palm.png" }
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-2.5 0.0 0.0,
2.5 0.0 0.0,
2.5 11.25 0.0,
-2.5 11.25 0.0,
]
}
coordIndex [ 0, 1, 2, 3 ]
texCoord TextureCoordinate {
point [
0.0 0.0,
1.0 0.0,
1.0 1.0,
0.0 1.0,
]
}
texCoordIndex [ 0, 1, 2, 3 ]
solid FALSE
}
}
]
}
# Fake tree shadow - a black semi-transparent rectangle with
# a texture map to give it the right shape
Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 0.0 0.0
transparency 0.5
}
texture ImageTexture { url "palmsh.png" }
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-2.5 0.05 2.5,
2.5 0.05 2.5,
2.5 0.05 -2.5,
-2.5 0.05 -2.5,
]
}
coordIndex [ 0, 1, 2, 3 ]
texCoord TextureCoordinate {
point [
0.0 0.0,
1.0 0.0,
1.0 1.0,
0.0 1.0,
]
}
texCoordIndex [ 0, 1, 2, 3 ]
solid FALSE
}
}
]
}
]
}
Transform { translation -5.0 -1.0 -6.0 scale 0.6 0.6 0.6 children USE Palm }
Transform { translation 5.0 -1.0 -9.0 children USE Palm }
Transform { translation 10.0 -1.0 -15.0 children USE Palm }


#
# Bouncing beach ball
#
DEF Ball Transform {
# animated translation
children [
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.5
diffuseColor 1.0 1.0 1.0
specularColor 0.7 0.7 0.7
shininess 0.4
}
texture ImageTexture { url "beach.jpg" }
textureTransform TextureTransform { scale 2.0 1.0 }
}
geometry Sphere { }
}
]
}

DEF ShadowBall Transform {
# animated translation
scale 1 0 1
translation 0 -0.9 0
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 0.0 0.0
transparency 0
}
}
geometry Sphere { }
}
]
}

DEF Clock TimeSensor {
cycleInterval 2.0
startTime 1.0
stopTime 0.0
loop TRUE
}

DEF Bouncer Script {
field SFFloat altura 3.0
eventIn SFFloat set_fraction
eventOut SFVec3f value_changed
eventOut SFVec3f shadowScale_changed

# change 'vrmlscript' to 'javascript' for newer browsers
url "vrmlscript:
function set_fraction( frac, tm ) {
y = 4.0 * altura * frac * (1.0 - frac);
value_changed[0] = 0.0;
value_changed[1] = y;
value_changed[2] = 0.0;

xzscale = 1.0 - 0.5 * y / altura;
shadowScale_changed[0] = xzscale;
shadowScale_changed[1] = 0.0;
shadowScale_changed[2] = xzscale;

}"
}

ROUTE Clock.fraction_changed TO Bouncer.set_fraction
ROUTE Bouncer.value_changed TO Ball.set_translation
ROUTE Bouncer.shadowScale_changed TO ShadowBall.set_scale

Read More
 
Powered by Blogger