You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

bendyclickr

Beginner

  • "bendyclickr" started this thread

Posts: 19

Location: Bendigo, Victoria

  • Send private message

1

Wednesday, March 10th 2010, 11:14pm

lookto with view.hlookat variable.

Hi all, trying to get a script to work but I am having problems:

Source code

1
2
3
4
5
6
7
8
9
<action name="previewscene">

  inc(view.hlookat,45);
  trace(view.hlookat); 
  set(v1,view.hlookat);
  trace(get(v1));
  lookto(get(v1),45,35,smooth(100,20,50));

</action>


The trace is in there as I am trying to see what value is passed to lookto. The value in v1 is correct but the lookto command causes the flash screen to go blank.

Now if I put the following code in it all works fine. It obviously has something to do with the view.hlookat variable:

Source code

1
2
3
4
5
6
7
<action name="previewscene">

  set(v1,45);
  trace(get(v1));
  lookto(get(v1),45,35,smooth(100,20,50));

</action>


Any help would be appreciated.

Cheers,
Marcus

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Wednesday, March 10th 2010, 11:29pm

Hi Marcus,

Try to get the variable direct:

Source code

1
2
3
4
5
6
7
8
9
<action name="previewscene">

  inc(view.hlookat,45);
  trace(view.hlookat); 
  set(v1,view.hlookat);
  trace(get(v1));
  lookto(get(view.hlookat),45,35,smooth(100,20,50));

</action>


SAlut.

bendyclickr

Beginner

  • "bendyclickr" started this thread

Posts: 19

Location: Bendigo, Victoria

  • Send private message

3

Wednesday, March 10th 2010, 11:30pm

Ignore me, I found the answer in a related post. *g*

Here is my working code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<action name="previewscene">

	set(v1,get(view.hlookat));
	inc(v1,30);
	lookto(get(v1), get(view.vlookat), get(view.fov), smooth(100,20,50));
	
	dec(v1,60);
	lookto(get(v1), get(view.vlookat), get(view.fov), smooth(100,20,50));
	
	inc(v1,30);
	lookto(get(v1), get(view.vlookat), get(view.fov), smooth(100,20,50));

</action>


I am using the code for an embedded panorama on my website to preview it after loading. It looks left 30° right 60° then back to the original starting view.

Thanks for taking the time to comment michel.

Cheers,
Marcus

This post has been edited 1 times, last edit by "bendyclickr" (Mar 11th 2010, 3:49am)


Similar threads