:-object titlemove2: [bcilib].

var count = 5000.
var distance =  20.0.
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.