You are not logged in.

1

Sunday, April 11th 2010, 12:30pm

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:

Source code

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

This post has been edited 1 times, last edit by "rctdeclan" (Apr 11th 2010, 1:55pm)


2

Sunday, April 11th 2010, 6:20pm

Anyone?

3

Sunday, April 11th 2010, 8:20pm

Try

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

Regards
Greg

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

4

Sunday, April 11th 2010, 8:33pm

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

This post has been edited 1 times, last edit by "Zephyr" (Apr 11th 2010, 8:46pm)


Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

5

Sunday, April 11th 2010, 8:45pm

Source code

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

Sunday, April 11th 2010, 8:53pm

Thank you, it works now.

I think the documentation needs to be updated...

Declan

7

Sunday, April 11th 2010, 9:05pm

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

Monday, April 12th 2010, 11:30am

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

Friday, December 28th 2012, 8:30pm

Hi to all!

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

10

Saturday, December 29th 2012, 1:18pm

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:

Source code

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

Saturday, December 29th 2012, 9:13pm

Hi!
many thanks!

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

Source code

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