Rotation Demo Issues...

Monkey Forums/Monkey Programming/Rotation Demo Issues...

Neuro(Posted 2011) [#1]
Is anyone else having issues running the rotation sample demos (Rotation sickness, and Jump rotate)? It appears to run extremely slow, and have color issues when running on HTML 5 browsers. I've tested this on Firefox 4.0, IE 9.0, Chrome 12.0, and Safari browsers on my MacBook Pro and multiple Window 7 laptops all with the same results. Also tested an Open GL, and IOS version with the same results too. The demos seem to stop working right at around Monkey version 3.9. Any ideas?


slenkar(Posted 2011) [#2]
they use setcolor which was enabled for html5 recently , it is slow on html5, disable it if you want to speed things up (by removing it from the code)

html5 may be the slowest target but it is fast to compile and crashes in a way that is easier to debug.


DruggedBunny(Posted 2011) [#3]
Yeah, SetColor screwed them up. I'd swear I updated them for future use (on the BRL testers forum), but since the Blitz site is down I can't prove it!

I must have done something wrong originally, as the demos fail to set things back to SetColor 255, 255, 255 before drawing the rocket, etc. If you put that before the For/Next loop in each case, it should sort it (from memory).


Neuro(Posted 2011) [#4]
Thanks guys, but is it only suppose to slow down in HTML 5? Cause the same code also crawls when running on OGL or IOS too.


DruggedBunny(Posted 2011) [#5]
Strange, I wouldn't have thought it affected OpenGL, but I can't test this right now. (I also don't have an IOS device.)

The code was setting the colour to green, drawing the 'ground', then drawing the blocks in a For/Next loop. Because SetColor had no effect on images before, it was fine.

After the change, it's manually colouring each image then drawing it. Putting a SetColor 255, 255, 255 before the For/Next loop fixes this, as images' colours are not manually changed with 255, 255, 255, so it should run full-speed again.

Here's rotationsickness.monkey fixed:



... and here's jump_rotate.monkey:




Neuro(Posted 2011) [#6]
Thanks DruggedBunny. But new codes, doesn't compiles on GLFX and on HTML 5 it throws this error :
TypeError : Unable to get value of the property 'bbm_SetHandle': object is null or undefined


DruggedBunny(Posted 2011) [#7]
Did you save it in the same folder as the original, and delete the .build folder? I don't see why it should fail, since that's a Monkey command...

Just tried copying and pasting both over the originals and they're working fine here on both HTML5 and GLFW.