OO 2001
[] readme course preface 1 2 3 4 5 6 7 etc lectures dialogs resources

talk show tell print

dialog-8.pl (dlp /vr )


  

dialog

object


  
  :-object object_dialog_8 : [bcilib].
  
  var left = 'connie'.
  var right = 'connie'.
  var url = '@vr-dialog-8.wrl'.
  var choice = 0.
  var max = 12.
  
  main :-
          %%format('Loading dialog from ~w~n', [url]),
          %%format('Please wait ...~n'),
          loadURL(url),
          delay(5000),
          dialog(2000).
  
  

convenience


  
  set(T,F,mfstring(X)):- setMFString(T,F,X).
  set(T,F,sfint32(X)):- setSFInt32(T,F,X).
  set(T,F,sffloat(X)):- setSFFloat(T,F,X).
  set(T,F,sftime(X)):- setSFTime(T,F,X).
  set(T,F,sfcolor(R,G,B)):- setSFColor(T,F,R,G,B).
  set(T,F,sfvec3f(X,Y,Z)):- setSFVec3f(T,F,X,Y,Z).
  
  

dialog


  dialog(Delay) :-
          repeat,
                  right(choice,Delay),
                  left(choice,Delay),
                  ++choice,
          choice == max.
  
  right(C,D) :-
          phrase(r,C,X),
          set(right,string,mfstring(['...',''])),
          set(right,type,sfint32(0)),
          set(right,bulb_scale,sfvec3f(1.2,1.0,1.0)),
          %%set(right,bulb_scale,sfvec3f(0.6,0.4,1.0)),
          set(right,text_scale,sfvec3f(0.5,1.0,1.0)),
          set(right,text_translation,sfvec3f(0.0,0.0,0.0)),
          set(right,string,mfstring(['...',''])),
          set(right,color,sfcolor(1.0,0.0,0.0)),
          set(right,text,sfcolor(0.0,1.0,1.0)),
          !,
          xgesture(r,C),
          delay(1000),
          set(right,string,mfstring(X)),
          delay(D).
  
  left(C,D) :-
          phrase(l,C,X),
          set(left,string,mfstring(['...',''])),
          set(left,type,sfint32(1)),
          set(left,string,mfstring(['...',''])),
          set(left,color,sfcolor(0.0,1.0,1.0)),
          set(left,text,sfcolor(1.0,0.0,0.0)),
          set(left,bulb_scale,sfvec3f(1.0,1.2,1.0)),
          %%set(left,bulb_scale,sfvec3f(0.5,0.6,1.0)),
          set(left,text_scale,sfvec3f(0.5,1.0,1.0)),
          set(left,text_translation,sfvec3f(-0.7,0.0,0.0)),
          !,
          xgesture(l,C),
          delay(1000),
          set(left,string,mfstring(X)),
          delay(D).
  
  xgesture(R,C) :-
    format('gesture ~w ~w ~n',[R,C]),
    gesture(R,C).
  
  gesture(r,0) :- !, set(right,gesture1,sftime(0.0)).
  
  
  
  
  
  
  
  gesture(r,4) :- !, set(right,gesture2,sftime(0.0)).
  
  
  
  
  
  
  gesture(r,11) :- !, set(right,gesture2,sftime(0.0)).
  gesture(_,_):- !.
  
  phrase(r,0, [ 'how', 'are', 'you?' ]            ).
  phrase(l,0, [ 'fine', 'thank', 'you' ]          ).
  phrase(r,1, [ 'tell', 'me', '...' ]             ).
  phrase(l,1, [ 'yes', 'eh', '...' ]              ).
  phrase(r,2, [ 'what do', 'you think', 'of' ]    ).
  phrase(l,2, [ 'what?', '...' ]                 ).
  phrase(r,3, [ 'the opportunities', '' ,'!' ]    ).
  phrase(l,3, [ 'what do', 'you mean?' ]         ).
  phrase(r,4, [ 'of studying', '...' ]           ).
  phrase(l,4, [ 'studying what', '...?' ]        ).
  phrase(r,5, [ 'please', 'let me know', '...' ]  ).
  phrase(l,5, [ 'yes eh,', 'I think ...' ]       ).
  phrase(r,6, [ 'now,', 'what do you', 'think?' ] ).
  phrase(l,6, [ 'I think', 'that', 'studying', '...']).
  phrase(r,7, [ 'what', 'about', 'studying?' ]    ).
  phrase(l,7, [ 'studying', 'involves', 'discipline']).
  phrase(r,8, [ 'yes eh', '?' ]                  ).
  phrase(l,8, [ 'and', 'motivation', '...' ]      ).
  phrase(r,9, [ 'It is like', 'living!' ]        ).
  phrase(l,9, [ 'indeed', '!' ]                  ).
  phrase(r,10, [ 'But ', 'I am', 'not alive' ]     ).
  phrase(l,10, [ 'So,', 'what', 'are you?' ]       ).
  phrase(r,11, [ 'an ', 'agent' ]                 ).
  phrase(l,11, [ 'I always' ,'wanted to be', 'an agent' ] ).
                                              
  
  :-end_object object_dialog_8.
  
  


[] readme course preface 1 2 3 4 5 6 7 etc lectures dialogs resources
eliens@cs.vu.nl

draft version 0.1 (15/7/2001)