Forums > Javascript

February 2, 2009 | 9:09 pm

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

var jsketch = new JitterObject("","context");
var jhand = new JitterObject("",;

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("","context");
var jhand = new JitterObject("","context");

And I’ve also tried:
var jhand = new JitterObject("",jsketch);


February 2, 2009 | 9:19 pm

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. :(


February 2, 2009 | 9:28 pm

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.

I am now trying:

function bang()


February 2, 2009 | 9:36 pm

Check out jitterhittest.js example provided in the javascript ui

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’s immediate mode.


February 3, 2009 | 12:00 am

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’.


Viewing 5 posts - 1 through 5 (of 5 total)

Forums > Javascript