Presentation is loading. Please wait.

Presentation is loading. Please wait.

DLP for Virtual Environments (I)

Similar presentations


Presentation on theme: "DLP for Virtual Environments (I)"— Presentation transcript:

1 DLP for Virtual Environments (I)
VRML EAI (External Authoring Interface)

2 DLP Objects and Virtual Worlds

3 VRML Scene Graph #VRML V2.0 utf8 Transform { translation 0 0 0
rotation children [Shape {appearance Appearance { material Material { diffuseColor }} geometry Cylinder { height 2.0 radius 1.0}}]}

4 VRML Coordinate System
-Z -X +X +Z -Y

5 Rotations in VRML Angle in radians 1 Rotation = <1, 0, 0, 1.57>
The axis of rotation 1 Right-hand Rule

6 VRML Nodes, Fields, and Types
#VRML V2.0 utf8 Transform { translation 0 0 0 rotation children [Shape {appearance Appearance { material Material { diffuseColor }} geometry Cylinder { height 2.0 radius 1.0}}]} translation SFVec3f rotation SFRotation diffuseColor SFColor height SFFloat

7 Design 3D Objects for DLP Use
Define object names on VRML nodes Manipulating values on the fields of defined objects #VRML V2.0 utf8 DEF cylinder Transform { translation 0 0 0 rotation children [Shape {appearance Appearance { material DEF cylinderMaterial Material { diffuseColor }} geometry Cylinder { height 2.0 radius 1.0}}]}

8 DLP 3D Predicates (bcilib)
getSFVec3f(ObjectName,Field, X,Y,Z) setSFVec3f(ObjectName,Field, X,Y,Z) getSFRotation(ObjectName,Field, X,Y,Z,R) setSFRotation(ObjectName,Field,X,Y,Z,R) getSFColor(ObjectName,Field, R, G, B) setSFColor(ObjectName,Field, R, G, B) …….

9 DLP 3D Predicates (bcilib)
loadURL(URL) getPosition(ObjectName,X,Y,Z) =getSFVec3f(ObjectName,translation,X,Y,Z) setPosition(ObjectName,X,Y,Z) =setSFVec3f(ObjectName,translation,X,Y,Z) getRotation(ObjectName,X,Y,Z,R) =getSFRotation(ObjectName, rotation,X,Y,Z,R) setRotation(ObjectName,X,Y,Z,R)

10 Launch DLP Objects from Web Browsers
<html> <body bgcolor=white> <embed src="./../vrml/root.wrl" width="100%" height="100%"> <applet codebase="./classes" archive="dlpsys.jar" code="dlpbrow.class" width=600 height=300 MAYSCRIPT> <param name="mayscript" value="true"> <param name="cols" value="60"> <param name="rows" value="10"> <param name="object" value="dlp-example1"> </applet> </body> </html>

11 Example: Moving Titles

12 Design 3D Objects #VRML V2.0 utf8
DEF myViewpoint Viewpoint {position orientation } Transform { translation rotation children [Transform {translation rotation children Shape {appearance Appearance { texture ImageTexture { url "star1.jpg" repeatS TRUE repeatT TRUE } textureTransform TextureTransform {scale 30 10} material Material {diffuseColor emissiveColor }} geometry Cylinder { height 2000 radius 2.5 top TRUE bottom FALSE}} }]}

13 Transform {translation -2 3 50 scale 0.3 0.3 0.3
children [Shape {appearance Appearance { material Material {diffuseColor 1 1 0 emissiveColor 1 0 0}}} Text { string "Intelligent Multimedia Technology" }] } Transform {translation scale Text { string "Distributed Logic Programming" }] } …… Sound {minFront 1000 minBack 1000 intensity 20 source AudioClip { loop TRUE url ["mozart38.wav"]}}

14 DLP Program: Moving Title
:-object titlemove0: [bcilib]. var count = 3000. var increment = 0.15. var url='./title/title0.wrl'. %note that the path is relative to ‘root.wrl’ in the html file. main :- text_area(Browser), set_output(Browser), loadURL(url), sleep(3000), move_title(count). move_title(0):-!. move_title(N):- N1 is N-1, getSFVec3f(myViewpoint,position, X,Y,Z), Znew is Z - increment, setSFVec3f(myViewpoint, position,X,Y,Znew), sleep(150), move_title(N1). :-end_object titlemove0.

15 Example: Moving Title (1)
change the viewpoint’s position regularly the distance between the viewpoint and the title is stable.

16 ...... DEF title Transform {translation scale children [Shape {appearance Appearance { material Material {diffuseColor 1 1 0 emissiveColor 1 0 0}}} Text { string ”Multimedia Authoring II: Flying Title" }] }

17 DLP Program: Moving Title (1)
:-object titlemove1: [bcilib]. var count = 3000. var increment = 0.15. var url='./title/title0.wrl'. var distance = 5.0. main :- text_area(Browser), set_output(Browser), loadURL(url), sleep(3000), move_title(count). move_title(0):-!. move_title(N):- N1 is N-1, getSFVec3f(title, translation, Xt,Yt,_Zt), getSFVec3f(myViewpoint,position, X,Y,Z), Zt is Z - distance, setSFVec3f(title, translation,Xt,Yt,Zt), Znew is Z - increment, setSFVec3f(myViewpoint,position,X,Y,Znew), sleep(150), move_title(N1). :-end_object titlemove1.

18 Example: Moving Title (2)
change the viewpoint’s position regularly change the title’s position regularly

19 DLP Program: Moving Title (2)
:-object titlemove2: [bcilib]. var count = 5000. var distance= var increment = 0.15. var url='./title/title1.wrl'. var countv=100. main :- text_area(Browser),set_output(Browser), loadURL(url), sleep(3000), move_title(count). move_title(0):-!. move_title(N):- N1 is N-1, getSFVec3f(title, translation, Xt,Yt,_Zt), getSFVec3f(myViewpoint,position, X,Y,Z), Zt is Z - distance, setSFVec3f(title, translation,Xt,Yt,Zt), move_viewpoint(myViewpoint,position(X,Y,Z), countv), move_title(N1). move_viewpoint(_V,_,0):-!. move_viewpoint(V,position(X,Y,Z),C):-C1 is C-1, Znew is Z-increment, setSFVec3f(V,position,X,Y,Znew), sleep(100), move_viewpoint(V,position(X,Y,Znew),C1). :-end_object titlemove2.

20 Example: Moving Title (3)
change the viewpoint’s position regularly change the title’s position regularly change the text regularly

21 DLP Program: Moving Title (3)
:-object titlemove3: [bcilib]. ...... move_title(0):-!. move_title(N):- N1 is N-1, getSFVec3f(title, translation, Xt,Yt,_Zt), getSFVec3f(myViewpoint,position, X,Y,Z), Zt is Z - distance, setSFVec3f(title, translation,Xt,Yt,Zt), setTitleText(titletext,N), move_viewpoint(myViewpoint,position(X,Y,Z), countv), move_title(N1). setTitleText(O,N):- I is N mod 5, title_text(I,T), setMFString(O, string, [T]). title_text(1, 'Multimedia Authoring II'):-!. title_text(2, 'Flying Title Example'):-!. title_text(3, 'Changing Title Strings'):-!. title_text(4, 'VRML+Java+ Prolog'):-!. title_text(0, 'Z. Huang 2002'):-!. title_text(_, 'Thank You very much!'):-!. :-end_object titlemove3.

22 Exercises 1. Design a DLP program to implement a rolling text, namely,
the text can move along Y-dimension from down to up. You can design your own vrml file, or download it from the website: 2. Based on the moving title example 3, design a DLP program to implement moving titles in which the texts and the colors of the titles are changed regularly, using the following fact format: title_text(1, 'Multimedia Authoring II', red):-!. title_text(2, 'Flying Title Example', yellow):-!. title_text(3, 'Changing Title Strings', green):-!. ...... The vrml file is available at:

23 Accessibility of your design
After you have done your exercises, make them accessible and executable from your project web site. Add a brief description on them. Send your DLP source code to your TA by , and let him know the link of your MMA2 webpage.

24 A recommended file structure
bin dlpsys.jar,*.class, etc. classes examples dlp mma2 lib ex1.pl, ex1.htm,etc title title2.wrl title7.wrl, etc. <home directory> vrml …... root.wrl dlpsys.jar,*.class, etc. classes exercises ex1.htm,etc www mma2 title title2.wrl,etc. vrml …... root.wrl


Download ppt "DLP for Virtual Environments (I)"

Similar presentations


Ads by Google