Docsity

Galeria Virtual VRML, Notas de estudo de Sistemas de Informação

Toggle sidebar
bg1
UNIVERSIDADE BRAZ CUBAS
GALERIA VIRTUAL
ENGENHARIA DE COMPUTAÇÃO
DISCIPLINA PROJETO ASSISTIDO POR COMPUTADOR
PROFESSOR JOSÉ DEMÍSIO SIMÕES DA SILVA
Bianca Lubia Polidoro 98289
Fabio Pires Medina 89602
Daniel de Souza Carvalho 92177
11O SEMESTRE – JUNHO DE 2000
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Pré-visualização parcial do texto

Baixe Galeria Virtual VRML e outras Notas de estudo em PDF para Sistemas de Informação, somente na Docsity!

UNIVERSIDADE BRAZ CUBAS

GALERIA VIRTUAL

ENGENHARIA DE COMPUTAÇÃO

DISCIPLINA PROJETO ASSISTIDO POR COMPUTADOR

PROFESSOR JOSÉ DEMÍSIO SIMÕES DA SILVA

Bianca Lubia Polidoro 98289

Fabio Pires Medina 89602

Daniel de Souza Carvalho 92177

O

SEMESTRE – JUNHO DE 2000

ÍNDICE

  • 1.Introdução....................................................................................
  • 2.Desenvolvimento.........................................................................
  • 3.Conclusão....................................................................................
  • 4.Referências..................................................................................

2. DESENVOLVIMENTO

Com base nos manuais e referências, utilizamos apenas um editor de texto simples para

desenvolver o código.

Para a construção do mundo virtual, utilizamos apenas objetos primitivos: caixas,

cilindros, cones, esferas e texto 2D (Veja figura 2), apesar de ser possível a criação de objetos

mais complexos com grande números de vértices. Nos objetos aplicamos as transformações:

translação, rotação, escalonamento, reutilização de objetos e aplicamos texturas para os

“quadros” da galeria, com pinturas de artistas brasileiros e fotos. Utilizamos também, sensores de

toque ( Touch Sensor ), plano ( Plane Sensor ), ancora ( Anchor Sensor ) e cilindro ( Cylinder Sensor )

para criar objetos interativos.

A navegação pode ser feita por Mouse ou Joystick nos três plug-ins testados.

O projeto está disponível na internet, na página: http:\www.geocities.com\gvvrml

Figura 2

Abaixo demonstramos o código VRML do nosso projeto:

#VRML V2.0 utf

Galeria Virtual - Trabalho de Realidade Virtual - CAD

UBC - Engenharia de Computação - Abril de 2000

Bianca Lubia Polidoro - 98289

Daniel de Souza Carvalho - 92177

Fabio Medina - 89602

Para saber mais sobre VRML: http://www.vrml.org/

WorldInfo { title "Galeria Virtual"

info ["Bianca Polidoro - [email protected]" "Daniel Carvalho - [email protected]" "Fabio Medina - [email protected]"] }

NavigationInfo { headlight TRUE avatarSize[0.2 3 1] }

Transform { children [

#Posições de camera

Viewpoint { position -25 3 20 orientation 0 5 0 -5. description "Inicial" }

Viewpoint { position 0 3 30 description "Lateral" }

Viewpoint { position -25 20 20 orientation -2 -5 0 -5. description "Vista superior" }

#Luz - geral

DirectionalLight { direction 0 -3 0 }

#Fundo - Céu

Background { skyColor [ 0.0 0.6 1.0, 0.0 0.65 1.0, 0.0 0.7 1.0, 0.9 0.9 1. ]

skyAngle [ 1.29, 1.36, 1.571 ]

groundColor [ 0.0 0.22 0.0, 0.0 0.22 0.0, 0.0 0.22 0. ]

groundAngle [ 0.7, 1.571 ] }

#Chão verde ###########################################################

Transform {

appearance Appearance { material Material { diffuseColor 0.0 0.0 .6 }

} } ] }

Transform { # Braço esquerdo translation -.5 1.2 0 children [ Shape { geometry Cylinder { height 1.5 radius .2 } appearance Appearance { material Material { diffuseColor 0.0 0.0 .6}

]

Transform { # Tronco translation 0 1 0 scale 1 1. children [ Shape { geometry Cylinder { height 2 radius .5 } appearance Appearance { material Material { diffuseColor 0.0 0.0 .6 }

} } ] } Transform { # Perna direita translation -.3 -1 0 children [ Shape { geometry Cylinder { height 2 radius .2 } appearance Appearance { material Material { diffuseColor .3 0 0 }

]

Transform { # Perna Esquerda translation .3 -1 0 children [ Shape { geometry Cylinder { height 2 radius .2 } appearance Appearance { material Material { diffuseColor .3 0 0 }

} } ] } ] } ] }

DEF homem_fora Transform { # Homem - o que fica andando translation -80 1.5 - scale .6 .6. rotation 0 1 0 1. children [ USE homem ] }

DEF homem_pos PositionInterpolator { key [0, 0.2, 0.4, 0.6, 1] keyValue [-70 1.5 -30, 10 1.5 -30, 10 1.5 30, -50 1.5 30 -70 1.5 -30] }

DEF homem_timer TimeSensor { cycleInterval 40 loop TRUE }

Disco Voador

DEF ovini Transform { translation 0 2 0 children [ Transform { scale 2 1 2 children [ DEF ovini_cor ColorInterpolator { key [0, 0.33, 0.66, 1] keyValue [ 1 0 0, 0 1 0, 0 0 1, 1 0 0 ] } Shape { geometry Sphere { radius 1} appearance Appearance { material DEF ovini_mat Material { diffuseColor 1 0 0 transparency. } } } ] }

Transform { scale 1 .1 1 children [ DEF ps PlaneSensor { maxPosition 60 20 minPosition -90 2 } Shape { geometry Sphere { radius 4}

children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -36 1 - children [ USE arvore ] }

Transform { # Arvore - cópia da original translation 30 1 20 children [ USE arvore ] }

Transform { # Arvore - cópia da original translation 5 3 35 scale 3 3 3 children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -30 .5 - scale .5 .5. children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -70 .5 - scale .5 .5. children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -33 2 - scale 2 2 2 children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -75 2 0 scale 2 2 2 children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -40 2 60 scale 1 1 1 children [

USE arvore ] }

Transform { # Arvore - cópia da original translation -70 2 20 scale 1 1 1 children [ USE arvore ] }

Transform { # Arvore - cópia da original translation -10 2 10 scale 1 2 1 children [ USE arvore ] }

Placa giratória

Transform { translation -5 2.5 - children [ DEF cs_placa CylinderSensor { enabled TRUE offset 0 autoOffset TRUE minAngle 0 maxAngle - diskAngle 0. }

DEF placa Transform { children [ Shape { geometry Box { size 2.5 2 2.5} appearance Appearance { material Material { diffuseColor 1 1 1 transparency. } texture ImageTexture { url "nave.gif" } } } Transform { translation 0 -2 0 children [ Shape { geometry Cylinder { height 2 radius 1} appearance Appearance { material Material { diffuseColor .3 .3 .3} } } ] } ] } ] }

#Chão da galeria - Cubo com textura de madeira #######################

geometry Box {size .1 4 3.3} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "auto_retrato.gif" } } } ] }

Transform { # 2º Quadro translation 0.5 0 - children [ Shape { geometry Box {size .1 3.2 5} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "bananal.gif" } } } ] }

Transform { # 3º Quadro translation 0.5 0 - children [ Shape { geometry Box {size .1 4 3} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "mestico.gif" } } } ] }

Transform { # 4º Quadro translation 0.5 0 0 children [ Shape { geometry Box {size .1 3.7 4} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "mulheres.gif" } } } ] }

Transform { # 5º Quadro translation 0.5 0 5 children [ Shape { geometry Box {size .1 4 3.5} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "vendedor_frutas.gif" } } } ] }

Anchor { children [

Transform { # 6º Quadro translation 0.5 0 10 children [ Shape { geometry Box {size .1 3.3 4} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "mulata.gif" } } } ] } ] url "pinturas.html" description "Detalhes sobre as pinturas" }

]

#Paredes Transparentes ###################################

Transform { # Parede translation -90 1 - #rotation 0 1 0 1. children [ DEF parede_transparente Group { children [ Shape { geometry Box {size 15.5 2 1} appearance Appearance { material Material { diffuseColor 1 1 1 } } } Transform { translation 0 5 0 children [ Shape { geometry Box {size 15.5 8 1} appearance Appearance { material Material { #diffuseColor 1 1 1 transparency. } } } ] } ]

}]

Transform { # Segurna parede transparente - cópia da original translation -70.25 1 - children [ USE parede_transparente ] }

#Paredes das fotos ##################################################

appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "fabio.jpg" } } } ] }

Transform { # Quadro torto translation -0.5 0.5 - rotation 0 0 1 1. children [ DEF cs_quadro CylinderSensor { enabled TRUE offset 0 autoOffset TRUE minAngle 0 maxAngle - diskAngle 0. }

DEF quadro Transform { children [ Shape { geometry Box { size 1.5 0.1 2} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "demisio.jpg" } } } ] } ] }

Transform { translation -0.5 0 - children [ Shape { geometry Box {size .1 3 4} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "turma.jpg" } } } ] }

Anchor { children [ Transform { translation -0.5 0 4. children [ Shape { geometry Box {size .1 2 4} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "dan_ta_ri.jpg" } } } ]

]

url "http://www.fortunecity.com/meltingpot/albania/890/" description "Ir para a página da turma de computação" }

Transform { translation -0.5 0 10 children [ Shape { geometry Box {size .1 3 4} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "bia_dan_ta.jpg" } } } ] }

Transform { translation -0.5 0 15 children [ Shape { geometry Box {size .1 4 3} appearance Appearance { material Material { diffuseColor 0 0 1 } texture ImageTexture { url "kelly.jpg" } } } ] } ] }

#Parede do quadro móvel ##################################################

Transform {

translation -80 2.5 -80. rotation 0 1 0 1. children [ Shape { geometry Box {size 1 5 35} appearance Appearance { material Material { diffuseColor 1 1 1 } #texture ImageTexture { url "nave.gif" } } }

Transform { # Parte transparente translation 0 5 0 children [ Shape { geometry Box {size 1 5 35} appearance Appearance { material Material { diffuseColor 1 1 1 transparency. } } } ]

3. CONCLUSÃO

Escolhemos utilizar VRML para desenvolver o projeto por atender a todos os itens

propostos:

1. Técnicas de realidade virtual

2. Ambiente 3D em perspectiva

3. Interatividade

4. Navegação por joystick

Alem disto é uma linguagem simples, rápida de se aprender, fácil de programar e é a

melhor opção para a publicação de modelos 3D pela WEB.

Projetos mais complexos com VRML podem ser desenvolvidos utilizando ferramentas de

apoio para a criação dos objetos, por exemplo o Macrostation.

Este projeto também pode ser implementado utilizando C++ e as bibliotecas OpenGL, no

entanto isto demandaria mais tempo e trabalho para atingir resultado semelhante.

4. REFERÊNCIAS

Plug-ins para rodar VRML (em ordem de nossa preferência):

  • Cosmo Player

http://www.cai.com/cosmo

  • Cortona

http://www.parallelgraphics.com/htm/en/prod/index.html

  • Microsoft VRML Viewer

http://www.microsoft.com

Consultas sobre o VRML:

  • WEB 3D CONSORTIUM

http://www.vrml.org/

  • Floppy's VRML Guide

http://www.vapourtech.com/vrmlguide/

  • Writing a VRML Modeler in DHTML JavaScript

http://developer.netscape.com/viewsource/antar_vrml/antar_vrml.html

  • Case Study: JavaScript Interface to VRML

http://developer.netscape.com/docs/technote/javascript/jsvrml/jsvrml.html

  • Netscape World - VRML Technique: Sensing the viewer's touch - March 1997

http://www.netscapeworld.com/nw-03-1997/nw-03-vrmltechnique.html