Rhemah Posted June 18, 2015 Share Posted June 18, 2015 what i really wanted to happen is have the glow value turn from 0.0 to 1.0 to 0.0 then stop.float FADE_PERIOD = 6.0; float TIMER_PERIOD = 0.25; float MIN_GLOW = 0.0; float MAX_GLOW = 1.0; float glowAtTime(float t) { float midPoint = 0.5*(MAX_GLOW+MIN_GLOW); float amplitude = 0.5*(MAX_GLOW-MIN_GLOW); return midPoint+amplitude*llSin(TWO_PI*t/FADE_PERIOD); } default { state_entry() { llSetTimerEvent(TIMER_PERIOD); } timer() { float glow = glowAtTime(llGetTime()); llSetPrimitiveParams([ PRIM_GLOW, ALL_SIDES, glow ]); } }and can someone teach me what does ++ do or * do im a bit confuse:matte-motes-confused: Link to comment Share on other sites More sharing options...
Sassy Romano Posted June 18, 2015 Share Posted June 18, 2015 ++ means increment by one, -- means decrement by one, * means multiply. Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 18, 2015 Share Posted June 18, 2015 And then you'll want a test in the timer event to llSetTimerEvent(0.0) if (glow >= 1.0), so that the timer doesn't keep chugging away and trying to increase glow beyond its upper limit. Link to comment Share on other sites More sharing options...
Rhemah Posted June 19, 2015 Author Share Posted June 19, 2015 is it like this? but it doesnt work:matte-motes-crying: timer() { float glow = glowAtTime(llGetTime()); llSetPrimitiveParams([ PRIM_GLOW, ALL_SIDES, glow ]); if (glow >= 1.0){llSetTimerEvent(0.0);} } Link to comment Share on other sites More sharing options...
Xiija Posted June 19, 2015 Share Posted June 19, 2015 here is a basic snippet you can play with to get it how ya like..? SLPPF has no delay, and you stop before 1.0 and 0.0 so the compiler wont go out of bounds. integer k; float x; integer tog = 1; float gap = 0.1; integer flag; default { state_entry() { } touch_start(integer total_number) { llSetTimerEvent(gap); } timer() { x += 0.05 * tog; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW, ALL_SIDES,x]); if(x >= 0.95) { tog = -tog; flag = 1; } if(x <= 0.05 && flag == 1) { x = 0.0; tog = 1; flag = 0; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW, ALL_SIDES,x]); llSetTimerEvent(0); } } } 1 Link to comment Share on other sites More sharing options...
Rhemah Posted June 19, 2015 Author Share Posted June 19, 2015 thanks xiija, i'll play with this one and hope i can do something i want with my project :matte-motes-big-grin-wink: Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now