|
|
|
|
|
 |
|
 |
Exponemos ahora algunos ejemplos de código en VMRL para hacer nuestros primeros gráficos.
PRIMITIVAS EN LENGUAJE VRMLAbrir el programa “Block de notas” y copiar los ejercicios (solo código en color negro)
--------------------------------------------------------------------------------
*****************************************************1) Cubo simple
#VRML V2.0 utf8
Shape {geometry Box { size 2.0 2.0 2.0 }}
*****************************************************2) Cubo con color y atributos:
#VRML V2.0 utf8
Shape {appearance Appearance {material Material {emissiveColor 1 0 0diffuseColor 0 0 0specularColor 1 1 0ambientIntensity 0.2transparency 0}}geometry Box { size 2.0 2.0 2.0 }}
En este post expondremos unos codigos VMRL para que sean ejecutados directamente.
*****************************************************3) Cilindro con color y atributos:
#VRML V2.0 utf8
Shape {appearance Appearance {material Material {diffuseColor 0.5 0.0 0.5ambientIntensity 0.2transparency 0 }}geometry Cylinder { radius 1 height 2 }}
*****************************************************4) Cilindro con textura:
#VRML V2.0 utf8
Shape {appearance Appearance {texture ImageTexture {url "http://www.gonomad.com/traveltalesfromindia/uploaded_images/Flowers-Flowers-small-flowers-753210.jpg"}}geometry Cylinder { radius 2 height 6 }}
*****************************************************5) Esfera simple con textura:
#VRML V2.0 utf8
Shape {appearance Appearance {texture ImageTexture {url "http://i.pbase.com/v3/75/491275/1/45909861.Abstratcolorpattern.jpg"}}geometry Sphere {radius 2.5}}
*****************************************************6) Esfera con color y atributos:
#VRML V2.0 utf8
Shape {appearance Appearance {material Material {emissiveColor 1 0 0diffuseColor 1 1 0specularColor 1 1 0ambientIntensity 0.2transparency 0}}geometry Sphere {radius 2.5}}
*****************************************************7) Cono con color y atributos:
#VRML V2.0 utf8
Shape {appearance Appearance {material Material {diffuseColor 0 0 1ambientIntensity 0.2transparency 0 }}geometry Cone {height 2.0bottomRadius 1.0bottom TRUEside TRUE}}
*****************************************************8) Primitivas: cubo, esfera, cono y cilindro
#VRML V2.0 utf8
#ESFERA ROJOTransform {translation 0.0 0.0 0.0children [Shape {appearance Appearance {material Material {diffuseColor 1 0 0ambientIntensity 0.2transparency 0.5 }}geometry Sphere { radius 1.0 }}]}
#CUBOTransform {translation -2.5 0.0 0.0children [Shape {appearance Appearance {material Material {diffuseColor 0 1 0ambientIntensity 0.2transparency 0.5 }}geometry Box { size 2.0 2.0 2.0 }}]}
#CONOTransform {translation 2.5 0.0 0.0rotation 1 0 0 1.5708 # x y z 90 gradoschildren [Shape {appearance Appearance {material Material {diffuseColor 0 0 1ambientIntensity 0.2transparency 0.5 }}geometry Cone {height 2.0bottomRadius 1.0bottom TRUEside TRUE}}]}
#CILINDROTransform {translation 5.0 0.0 0.0rotation 1 0 0 1.5708 # x y z 90 gradoschildren [Shape {appearance Appearance {material Material {diffuseColor 0.5 0.0 0.5ambientIntensity 0.2transparency 0.5 }}geometry Cylinder { radius 1 height 2 }}]} |
|
 |
|
 |
|
|
|
|
|
|
|
|