Sie sind nicht angemeldet.

1

Sonntag, 11. April 2010, 12:30

writing screen coordinates to log window

Hi,

i'm trying to write the sphere coordinates from screen position at mouse x and y to the log window.

I downloaded the mouse plugin from klaus and it works fine.

here's what i have:

Quellcode

1
<events onkeydown="if(keycode == 70,set(coord1,get(screentosphere(mouse.x,mouse.y)));trace(get(coord1)))" />


butt it says NULL... (because of the screentosphere, but why?)


Declan

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »rctdeclan« (11. April 2010, 13:55)


2

Sonntag, 11. April 2010, 18:20

Anyone?

3

Sonntag, 11. April 2010, 20:20

Try

get(mouse.x)
get(mouse.y)

Regards
Greg

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

4

Sonntag, 11. April 2010, 20:33

screentosphere has different vars

screentosphere(x,y,h,v);
spheretoscreen(h,v,x,y);

where x/y are the variables in screen coordinates,
and h/v the one in spherical coordinates,

it seems you are trying to get 4 vars in 1 coord var.

look at some syntax in this post

http://www.krpano.com/forum/wbb/index.ph…use.x#post13330

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Zephyr« (11. April 2010, 20:46)


Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

5

Sonntag, 11. April 2010, 20:45

Quellcode

1
2
3
4
5
   <events onkeydown="if(keycode == 70,getscreen())" />
      <action name="getscreen">
	 screentosphere(mouse.x,mouse.y,toh,tov);
	 trace(toh, tov);
   </action>

6

Sonntag, 11. April 2010, 20:53

Thank you, it works now.

I think the documentation needs to be updated...

Declan

7

Sonntag, 11. April 2010, 21:05

The documentation is current for the offically released 1.0.7 I know Klaus is trying to wrap up this 1.0.8 beta and should have the documentation updated with the official release of 1.0.8. With that said, I believe I read he is still working on beta 10 so the documentation may be put off just a bit longer.

8

Montag, 12. April 2010, 11:30

Hi,

the documentation is one of my biggest topics at the moment
my plan is to release it together with the next release,

best regards,
Klaus

9

Freitag, 28. Dezember 2012, 20:30

Hi to all!

i put the code into my xml but the coordinate there are not show into log panel!
*cry*

10

Samstag, 29. Dezember 2012, 13:18

Hi,

the example code from Zephyr is correct - it should print the coordinates every time you press the 'F' (keycode=70) key...

Here the example again with slightly modified formating:

Quellcode

1
2
3
4
5
6
<events onkeydown="if(keycode == 70,getscreen())" />

<action name="getscreen">
  screentosphere(mouse.x,mouse.y,toh,tov);
  trace('mouse=', mouse.x, '/', mouse.y, ' pano=',toh, '/', tov);
</action>


Best regards,
Klaus

11

Samstag, 29. Dezember 2012, 21:13

Hi!
many thanks!

the code is correct, i have change it to show the coordinate on click:

Quellcode

1
2
3
4
5
<events  	onclick="getscreen()" />
		<action name="getscreen">
			screentosphere(mouse.x,mouse.y,toh,tov);
			trace(toh," ", tov);
		</action>