In my turtle graphics app based on Eric's jdemogl1.ijs I want to use the
drawPrimitive() function to draw a line. For now I am experimenting with
drawing directly from ev_command_enter_ajax(ts).

My version of ev_command_enter_ajax() is below, and when I leave all 3
lines of code in, I get the error alert `ev_command_enter_ajax(d) failed`
[Btw, notice the 'd' in the parens]. I believe the values of color (ts[0])
and move (ts[1]) are correct strings created by the J code, because
alert(color); and alert(move); produced the expected result.

Any ideas about how to get the drawPrimitive() to work?

function ev_command_enter_ajax(ts)
{
 var color=ts[0];
 var move=ts[1];
 drawPrimitive(gl.LINES,color,move);
}

Btw, the next 3 lines are copied from Eric's jdemogl1.ijs. Does the last
one contain a typo regarding the final semicolon in the last one? (If so,
should it be before the right curly bracket?)

function ev_body_load(){init();} // must use JHS framework load handler
function ev_bgcolor_click(){jdoajax([],"");}
function ev_bgcolor_click_ajax(ts){bgcolor=eval(ts[0]);draw()};

Thank you,

-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to