09.01.2013 Views

* Virtual Reality Modeling Language – limbaj de ... - Duguleana Mihai

* Virtual Reality Modeling Language – limbaj de ... - Duguleana Mihai

* Virtual Reality Modeling Language – limbaj de ... - Duguleana Mihai

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VRML<br />

* <strong>Virtual</strong> <strong>Reality</strong> <strong>Mo<strong>de</strong>ling</strong> <strong>Language</strong> <strong>–</strong> <strong>limbaj</strong><br />

<strong>de</strong> mo<strong>de</strong>lare a mediilor virtuale.<br />

* Format <strong>de</strong> fisier utilizat pentru realizarea<br />

mediilor virtuale interactive 3D.<br />

* Compatibil cu World Wi<strong>de</strong> Web.<br />

* Extensia *.wrl


VRML<br />

* Un fisier VRML contine o colectie <strong>de</strong> obiecte aranjate intro<br />

ordine <strong>de</strong>finita <strong>de</strong> utilizator. La fel ca in mediul real, fiecare<br />

obiect corespun<strong>de</strong> unei reprezentari fizice cu urmatoarele<br />

caracteristici:<br />

- O forma specifica<br />

- Diferite caracteristici ale suprafetelor (culoare, masa, etc…)<br />

- O pozitie si orientare in spatiul tridimensional<br />

- Sunet<br />

-Lumini<br />

- Puncte <strong>de</strong> vizualizare


Aspecte Technice - Vizualizare<br />

* Pentru vizualizarea mediilor VRML, este necesar a se<br />

instala un browser VRML.<br />

* BS Contact 7.1 trial version:<br />

http://www.bitmanagement.<strong>de</strong>/download/<br />

* Cortona Player<br />

http://www.parallelgraphics.com/products/cortona/


Aspecte Technice - Editare<br />

•Pentru editare mediilor VRML se poate utiliza orice editor<br />

<strong>de</strong> text ( <strong>de</strong> exemplu Notepad)<br />

* Export din programe CAD<br />

* Programe specializate:<br />

- Cortona VRML Pad<br />

http://ms0.unitbv.ro/users/garbacia@unitbv.ro/Lab/


Structura scenei virtuale<br />

Root<br />

T1 T2 T3<br />

Geom 1 Geom 2 Geom 3 Geom 4<br />

Modificata T1<br />

Modificata T2<br />

Modificata T2<br />

T4<br />

Geom 5<br />

Modificata (T4)*(T3)


Structura unui fisier VRML<br />

•IMPORTANT-fiecare fisier trebuie ca sa incepa cu comentariu<br />

special referitor la tipul <strong>de</strong> encodare:<br />

#VRML V2.0 utf8<br />

-Infromeaza browser <strong>de</strong>spre tipul fisier VRML<br />

-este compatibil cu versiunea 2.0<br />

-este encodat cu standardul international utf8


Comentarii<br />

- pot fi adaugate codului<br />

utilizand caracterul diez: “#”<br />

- ajuta la intelegerea codului si<br />

<strong>de</strong> catre alte persoane<br />

#VRML V2.0 utf8<br />

# primul mediu virtual


Obiecte VRML<br />

-Fiecare obiecteVRML este<br />

<strong>de</strong>limitat <strong>de</strong> acolate “{”si“}”<br />

-Permit gruparea logica a<br />

instructiunilor<br />

-World Info :<strong>de</strong>finirea unui<br />

i<strong>de</strong>ntificator pentru fiecare fisier,<br />

i<strong>de</strong>ntificat <strong>de</strong> viewerVRML<br />

#VRML V2.0 utf8<br />

# primul mediu virtual<br />

WorldInfo<br />

{<br />

title "primul fisier vrml"<br />

}


Obiecte VRML<br />

- Fiecare obiect VRML este<br />

format din noduri si campuri<br />

Nod<br />

Camp<br />

#VRML V2.0 utf8<br />

# primul mediu virtual<br />

WorldInfo<br />

{<br />

title "primul fisier vrml"<br />

}<br />

DEF CUB Shape<br />

{<br />

appearance Appearance {<br />

material Material {<br />

}<br />

}<br />

geometry Box {<br />

}<br />

}


Obiecte VRML<br />

- ATENTIE la utilizarea acola<strong>de</strong>lor<br />

#VRML V2.0 utf8<br />

# primul mediu virtual<br />

WorldInfo{title "primul fisier vrml"}<br />

DEF CUB Shape {appearance Appearance { material<br />

Material {}}geometry Box {}}<br />

#VRML V2.0 utf8<br />

# primul mediu virtual<br />

WorldInfo<br />

{<br />

title "primul fisier vrml"<br />

}<br />

DEF CUB Shape<br />

{<br />

appearance Appearance {<br />

material Material {<br />

}<br />

}<br />

geometry Box {<br />

}<br />

}


Primitive VRML Shapes<br />

- Exista 4 tipuri <strong>de</strong> primitve VRML: Box, Sphere, Cone and Cylin<strong>de</strong>r<br />

-Sintaxa generala a unui astfel <strong>de</strong> nod este:<br />

Shape{<br />

geometry<br />

{<br />

#<strong>de</strong>finire geometrie(forma dimensiuni)<br />

}<br />

appearance Appearance<br />

{<br />

#Definirea proprietetilor materialului primitivei: culoare etc.<br />

Material{ }<br />

}<br />

}


Shape, Appearance,Material<br />

- Ordinea creearii este:<br />

Shape {<br />

Utilizat pentru crearea unui obiect (Cylin<strong>de</strong>r, Box, etc)<br />

Utilizat pentru specificarea materialului obiectului<br />

Appearance pentru obiectAppearance {<br />

Cuprin<strong>de</strong> subgrupurile pentru Material, Textura<br />

Material {<br />

diffuseColor: 0 0 0<br />

emissiveColor:0 0 0<br />

transparency :0 0 0


Box {<br />

Primitiva Box<br />

Sintaxa adaugata in campul geometry al nodului Shape:<br />

}<br />

field SFVec3f size 2.0 2.0 2.0


Exemplu Primitiva Box<br />

NavigationInfo<br />

{<br />

headlight TRUE<br />

}<br />

Viewpoint<br />

{<br />

orientation 0 1 0 -.52<br />

position -5 0 8<br />

}<br />

### creare cub<br />

Shape {<br />

geometry Box<br />

appearance Appearance<br />

{<br />

size 2.0 2.0 2.0<br />

}<br />

{<br />

material Material<br />

{<br />

emissiveColor 1 0 0<br />

}<br />

} ### Terminare acolada Appearance<br />

} ### Terminare acolada Shape


Culori<br />

In VRML culorile pot fi introduse utilizand valori “RGB”.<br />

Exemple culori:<br />

1, 1, 1 : Alb<br />

0, 0, 0 : Negru<br />

1, 0, 0 : Rosu<br />

0, 0, 1 : Albastru<br />

0, 1, 0 : Ver<strong>de</strong><br />

1, 1, 0 : Galben<br />

1, 0, 1 : Mov


Cone<br />

{<br />

Primitiva Cone<br />

Sintaxa adaugata in campul geometry al nodului Shape:<br />

}<br />

field SFFloat bottomRadius 1.0<br />

field SFFloat height 2.0 #inaltimea, trebuie sa fie mai mare ca 0<br />

field SFBool si<strong>de</strong> TRUE<br />

field SFBool bottom TRUE


Viewpoint<br />

{<br />

}<br />

### creare cub<br />

Exemplu Primitiva Cone<br />

orientation 0 1 0 -.52<br />

position -5 0 8<br />

Shape {<br />

geometry Cone<br />

{<br />

bottomRadius 1<br />

height 2<br />

si<strong>de</strong> TRUE<br />

bottom TRUE<br />

}<br />

appearance Appearance<br />

{<br />

material Material<br />

{<br />

emissiveColor 1 0 0<br />

}<br />

} ### Terminare acolada Appearance<br />

} ### Terminare acolada Shape


Cylin<strong>de</strong>r<br />

{<br />

Primitiva Cylin<strong>de</strong>r<br />

Sintaxa adaugata in campul geometry al nodului Shape:<br />

}<br />

field SFFloat bottomRadius 1.0<br />

field SFFloat height 2.0 #inaltimea, trebuie sa fie mai mare ca 0<br />

field SFBool si<strong>de</strong> TRUE<br />

field SFBool bottom TRUE<br />

field SFBool top TRUE


Viewpoint<br />

{<br />

}<br />

### creare cub<br />

Exemplu Primitiva Cylin<strong>de</strong>r<br />

orientation 0 1 0 -.52<br />

position -5 0 8<br />

Shape {<br />

geometry Cylin<strong>de</strong>r<br />

{<br />

bottomRadius 1<br />

height 2<br />

si<strong>de</strong> TRUE<br />

bottom TRUE<br />

top TRUE<br />

}<br />

appearance Appearance<br />

{<br />

material Material<br />

{<br />

emissiveColor 1 0 0<br />

}<br />

} ### Terminare acolada Appearance<br />

} ### Terminare acolada Shape


Sphere<br />

{<br />

Primitiva Sphere<br />

Sintaxa adaugata in campul geometry al nodului Shape:<br />

}<br />

field SFFloat radius 1.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!