Sie sind nicht angemeldet.

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

1

Donnerstag, 12. Mai 2011, 21:38

more math

I'm missing a few more math operations like math.floor, math.ceil, abs and maybe sqrt and pie? And maybe you could incorpate the math stuff of anoeben too :) or anoeben incorps these

2

Donnerstag, 12. Mai 2011, 22:44

You can simulate .floor and .ceil by subtracting resp. adding 0.49999 to the value before doing roundVal(). Sqrt can be done using pow(val, .5). Abs is available in my misc plugin:
Misc plugin; for loops and more
But yeah, I'ld welcome all of these in krpano ;-). Untill then, there's workarounds. I'll consider adding proper ceil and floor to the misc plugin.

PS: Pie? Yum. I'ld like me some... PI = 3.141592 (that's how far I come without looking it up).

3

Donnerstag, 12. Mai 2011, 22:47

i just tried your game, it is really nice, though i couldn't understand the language :p
great effort

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

4

Freitag, 13. Mai 2011, 14:15

You can simulate .floor and .ceil by subtracting resp. adding 0.49999 to the value before doing roundVal(). Sqrt can be done using pow(val, .5). Abs is available in my misc plugin:
Misc plugin; for loops and more
But yeah, I'ld welcome all of these in krpano ;-). Untill then, there's workarounds. I'll consider adding proper ceil and floor to the misc plugin.

PS: Pie? Yum. I'ld like me some... PI = 3.141592 (that's how far I come without looking it up).


So Math.Floor from my example @ arguments etc lesson, need help

Quellcode

1
2
3
div(tmp_div, get(i), get(columns)); 											
	js(floor(get(tmp_div))); 														
	mul(y_offset, get(floor), 80); 		


would be:

Quellcode

1
2
3
4
div(tmp_div, get(i), get(columns)); 	
sub(tmp_sub, tmp_div, 0.49999);
roundval(tmp_sub,0);
mul(y_offset, tmp_sub, 80);


?

PS. Don't mess with my PIE it will come a round and hit you in the face *tongue*

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

5

Freitag, 13. Mai 2011, 14:16

i just tried your game, it is really nice, though i couldn't understand the language :p
great effort


How far did you get :P Found all 10 hidden relics? or stuck at the menu screen :P

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

6

Freitag, 13. Mai 2011, 16:14

Zitat



div(tmp_div, get(i), get(columns));
sub(tmp_sub, tmp_div, 0.49999);
roundval(tmp_sub,0);
mul(y_offset, tmp_sub, 80);


?

i put it here and it seams to work.. (?)
http://www.virtualtuur.com/krpano/simple/6/

so yes i should say, when i'm right ;-)

Tuur

7

Freitag, 20. Mai 2011, 19:40

Hi,

there are now more math functions available directly in krpano:
http://krpano.com/download/beta/#2011-05-20

best regards,
Klaus

8

Freitag, 20. Mai 2011, 20:15

Wohoo, awesome! I'll drink one to the demise of the current misc plugin :-)

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

9

Samstag, 21. Mai 2011, 23:41

*thumbsup* Did you really need an excuse to drink something :P We dutchmen can drink whenever we want :D

But thanks Klaus!