[ Mesaje noi · Membrii · Regulamentului forumului · Cautare · RSS ]
  • Pagina 1 din 1
  • 1
Forum » Internet » WEB3D » Câteva exemple de fişiere de VRML: (Fişiere comentate)
Câteva exemple de fişiere de VRML:
VirtualityData: Vineri, 29-Ian-2010, 06:34:15 | Mesaj # 1
Soldat
Grup: Membri
Mesaje: 4
Premii: 0
Reputaţie: 0
Status: Offline
Câteva exemple de fişiere de VRML:
Întrucât am înţeles că mulţi dintre noi suntem la şcoală sau la liceu, vom crea nişte exemple care pot fi înţelese uşor.
01) Punctul
Quote
#VRML V2.0 utf8

Transform
{
children
Shape
{
appearance Appearance{material Material{}}
geometry PointSet {coord Coordinate {point 0 0 0} }
}
}

02) Segmentul de dreaptă

Quote
#VRML V2.0 utf8

Transform
{
children
Shape
{
appearance Appearance { material Material {} }
geometry IndexedLineSet
{
coord Coordinate
{
point
[
00 00 00
10 00 00
]

}
}
}
}

03) Triunghiul

Quote
#VRML V2.0 utf8
#triangle.wrl
Shape {
appearance Appearance {

material Material { }
}

geometry IndexedFaceSet {
coord Coordinate {
point [
-1.0 -1.0 0.0,
1.0 -1.0 0.0
1.0 1.0 0.0,
-1.0 1.0 0.0
]

}

coordIndex [ 3, 1, 2]
normalPerVertex TRUE
normal Normal {
vector [
0.0 0.0 1.0,
0.0 0.0 1.0,
0.0 0.0 1.0,
0.0 0.0 1.0,
]
}
normalIndex [ 3, 1, 2 ]
}
}

04) Pătratul

Quote
#VRML V2.0 utf8

Transform {
children Shape {
appearance Appearance {
material Material {
}

}

geometry IndexedFaceSet {
color NULL
coord Coordinate {
point [ -1 1 0,
-1 -1 0,
1 -1 0,
1 1 0 ]

}

normal NULL
texCoord NULL
ccw TRUE
colorPerVertex FALSE
convex TRUE
normalPerVertex TRUE
creaseAngle 0
solid FALSE
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ ]
}

}
}

05) Poligon oarecare

Quote
#VRML V2.0 utf8

Transform {
children Shape {
appearance Appearance {
material Material {
}

}

geometry IndexedFaceSet {
color NULL
coord Coordinate {
point [ -1 1 0,
-1 -1 0,
1 -1 0,
1 1 0,
-0.016627 1.00001 0.845923 ]

}

normal NULL
texCoord NULL
ccw TRUE
colorPerVertex FALSE
convex TRUE
normalPerVertex TRUE
creaseAngle 0
s olid FALSE
coordIndex [ 0, 1, 2, 3, 4, -1 ]
colorIndex [ ]
}

}
}

06) Cercul

Quote
#VRML V2.0 utf8

Transform {
children Shape {
appearance Appearance {
material Material {
}

}

geometry IndexedFaceSet {
color NULL
coord Coordinate {
point [ 1 0 0,
0.927257 0.374426 0,
0.71961 0.694378 0,
0.40727 0.913308 0,
0.0356776 0.999363 0,
-0.341105 0.940025 0,
-0.668262 0.743926 0,
-0.898196 0.439595 0,
-0.997454 0.0713099 0,
-0.951596 -0.30735 0,
-0.767294 -0.641295 0,
-0.471361 -0.88194 0,
-0.106851 -0.994275 0,
0.273204 -0.961956 0,
0.613512 -0.789686 0,
0.864562 -0.502527 0,
0.98983 -0.142257 0 ]

}

normal NULL
texCoord NULL
ccw TRUE
colorPerVertex FALSE
convex TRUE
normalPerVertex TRUE
creaseAngle 0
s olid FALSE
coordIndex [ 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, -1 ]
colorIndex [ ]
}

}
}

07) Piramida

Quote
#VRML V2.0 utf8

Shape {
geometry IndexedFaceSet {

coord Coordinate {
point [ # beteiligte Punkte
0 3 0 # 0. Pyramidenpunkt (Spitze)
0 0 -2 # 1. Pyramidenpunkt (Norden)
-2 0 0 # 2. Pyramidenpunkt (Westen)
0 0 2 # 3. Pyramidenpunkt (Sueden)
2 0 0 # 4. Pyramidenpunkt (Osten )
]

}

coordIndex [ # Polygone gegen Uhrzeiger, Ende: -1
4 3 2 1 -1 # 0. Face: Punkte 1 2 3 4 (Grundflaeche)
0 1 2 -1 # 1. Face: Punkte 0 1 2 (Nordwesten)
0 2 3 -1 # 2. Face: Punkte 0 2 3 (Suedwesten)
0 3 4 -1 # 3. Face: Punkte 0 3 4 (Suedosten)
0 4 1 # 4. Face: Punkte 0 4 1 (Nordosten)
]

colorPerVertex FALSE
color Color {
color [ # pro Face eine Farbe benennen
0 1 1 # 0. Face: Cyan
1 0 0 # 1. Face: Rot
1 1 0 # 2. Face: Gelb
0 1 0 # 3. Face: Gruen
0 0 1 # 4. Face: Blau
]
}
}
}

08) Cubul construit din feţe indexate

Quote
#VRML V2.0 utf8

Transform {
children Shape {
appearance Appearance {
material Material {
}

}

geometry IndexedFaceSet {
color NULL
coord Coordinate {
point [ 1 1 1,
1 -1 1,
-1 -1 1,
-1 1 1,
1 1 -1,
1 -1 -1,
-1 1 -1,
-1 -1 -1 ]

}

normal NULL
texCoord NULL
ccw FALSE
colorPerVertex FALSE
convex TRUE
normalPerVertex TRUE
creaseAngle 0
solid FALSE
coordInde x [ 0, 1, 2, 3, -1, 4, 5, 1,
0, -1, 6, 7, 5, 4, -1, 3,
2, 7, 6, -1, 3, 6, 4, 0,
-1, 2, 1, 5, 7, -1 ]
colorIndex [ ]
normalIndex -1
}

}
}

09) Cubul ca primitivă geometrică

Quote
#VRML V2.0 utf8

Transform {
children Shape {
appearance Appearance {
material Material {
}

}

geometry Box {
}

}
}

Ce observăm noi când privim fişierele de VRML de mai sus ?

Voi continua

 
Forum » Internet » WEB3D » Câteva exemple de fişiere de VRML: (Fişiere comentate)
  • Pagina 1 din 1
  • 1
Căutare: