Forums > Javascript

jit.gl.handle


jml
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("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



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

jml



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

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);
}

?


February 2, 2009 | 9:36 pm

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



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

jml


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