Sie sind nicht angemeldet.

1

Mittwoch, 10. März 2010, 23:14

lookto with view.hlookat variable.

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

Quellcode

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:

Quellcode

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

2

Mittwoch, 10. März 2010, 23:29

Hi Marcus,

Try to get the variable direct:

Quellcode

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.

3

Mittwoch, 10. März 2010, 23:30

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

Here is my working code:

Quellcode

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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »bendyclickr« (11. März 2010, 03:49)


Ähnliche Themen