Sie sind nicht angemeldet.

1

Dienstag, 16. Februar 2016, 11:50

Spheretoscreen gives NaN at some point

Hi,

i' am working on floating hotspot indicators using Spheretoscreen function.

everything works fine while i'm in 'some default' range of hotspot (seeing hotspot).

If i trun around panorama to another side of hotspot (hostpot behind fov), at certain value, the Spheretoscreen function gives me NaN.

How can i read' Spheretoscreen' stage coordinates of hotspot behind me?

any ideas?

regards,

2

Dienstag, 16. Februar 2016, 12:29

ok,

a saw this...

spheretoscreen for hotspots outside the viewport

is it possible to extend 'spheretoscreen' calculation?

3

Freitag, 19. Februar 2016, 07:14

is it possible to extend 'spheretoscreen' calculation?

That's impossible - see the illustration here:
spheretoscreen for hotspots outside the viewport

4

Freitag, 19. Februar 2016, 09:06

Hi Klaus,

thank you for reply, i understand that.

I wonder how can i calculate stage x1, x2 or x3 relative to hotspot ouf of view, see picture below:



Regards,

5

Freitag, 19. Februar 2016, 12:00

Perspective projection doesn't work that way!
As said that's impossible!

6

Freitag, 19. Februar 2016, 12:13

ok, thanks

Anoril

Schüler

Beiträge: 69

Wohnort: Paris, France

Beruf: Game Developer and Photographer

  • Nachricht senden

7

Freitag, 25. Januar 2019, 14:16

Hello!
I am asking myself: How do I check SphereToScreen result validity?
A call set vars with resulting data, but some times, when hotspots are out of screen, data is "NaN".
My point is that I don't know how to test "NaN"...


Quellcode

1
2
3
sphereToScreen(a, b, c, d);
if( c == NaN, trace(is NaN), trace(is not NaN));
if( c == Number.NaN, trace(is NaN), trace(is not NaN));

Above code does not work...
I tried to check against screen dimensions, but that fails too : NaN is both greater and lesser than any number ;)

regards,
« Quidquid latine dictum sit, altum sonatur »
Pentax stuff.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Anoril« (25. Januar 2019, 16:22)


8

Freitag, 25. Januar 2019, 23:57

Anoril,
I bookmarked Klaus' snipet of the code and love it. Do you see the difference?

Quellcode

1
2
sphereToScreen(a, b, c, d);
trace('c=', calc(c * 1.0 == c ? c : 'NOT a Number'), ' d=', d);

Simplex pulchrum est.
Pavel

Anoril

Schüler

Beiträge: 69

Wohnort: Paris, France

Beruf: Game Developer and Photographer

  • Nachricht senden

9

Mittwoch, 30. Januar 2019, 14:12

Thanks!
It works but I don't like the calculus it implies... By the way, I suppose I'm not in a situation where a mul and a test is a killer. :)
Thanks again!
Paul
« Quidquid latine dictum sit, altum sonatur »
Pentax stuff.