jit.gl.handle

Feb 2, 2009 at 9:09pm

jit.gl.handle

I’m trying to do the following and I’m certain that I’m missing something obvious:

var jsketch = new JitterObject(“jit.gl.sketch”,”context”);
var jhand = new JitterObject(“jit.gl.handle”,jsketch.name);

All I want to do is to have the jhand obj be linked to the jsketch obj. (?)

FWIW, I know I can do:
var jsketch = new JitterObject(“jit.gl.sketch”,”context”);
var jhand = new JitterObject(“jit.gl.handle”,”context”);

And I’ve also tried:
var jhand = new JitterObject(“jit.gl.handle”,jsketch);

jml

#42065
Feb 2, 2009 at 9:19pm

i’m thinking something along the lines of the following would work in my draw function:

jsketch.rotate = jhand.rotate;

but i’m missing something there as well. :(

jml

#150293
Feb 2, 2009 at 9:28pm

I found this thread, where Joshua points out what the correct syntax would be for what I’m trying to do, but it doesn’t seem to work in my example.

http://www.cycling74.com/forums/index.php?t=msg&goto=97987&rid=2282&S=e808c8b2d959cb15f185dd5a7e44995e&srch=jit.gl.handle#msg_97987

I am now trying:

function bang()
{
jsketch.glrotate(jhand.rotate);
}

?

#150294
Feb 2, 2009 at 9:36pm

Check out jitterhittest.js example provided in the javascript ui
examples:

handledest.position = handle.position;
handledest.rotate = handle.rotate;

You probably don’t want to add a glrotate to your command list, but
rather do it for the sketch object’s position and rotate attributes
like the above, unless you’re doing something really advanced with
jit.gl.sketch’s immediate mode.

-Joshua

#150295
Feb 3, 2009 at 12:00am

you’re right.
i certainly don’t need any extra commands in there. :)

thanks for pointing me in the right direction.
that answers all of my q’s about contexts for handlin’.

jml

#150296

You must be logged in to reply to this topic.