Forums > Jitter

jit.gl.sketch screentoworld

October 4, 2012 | 7:23 am

I have 2 gl.sketch objects linked to a node object. A gl.handle is also connected to the node.

It seems like the "screentoworld" message sent to the sketch objects don’t respond to the transformations done by the handle.

Am I missing something ?

Here a patch to demonstrate.

Thanks

– Pasted Max Patch, click to expand. –

October 4, 2012 | 9:30 am

Hi,

It doesn’t respond to transformations, because you are querying the "size" attribute of your jit.wjindow.
–> change your window size and the numbers change.
What are you trying to achieve?


October 4, 2012 | 1:52 pm

Yes, I ask the size too (the button is directly connected to getsize message)
If I change the size of the window, yes the numbers change, but there still not what I expect.

The patch is drawing a lot of rectangles/lines (thousands)
The coordinates are generated by the patch, but I want them to stay (+/-) in the field of view of the camera.

Ah ! And just writing that I thought I just found the mistake: moving the object but keeping the camera in the same place, so the field of view is the same.
I tried moving the camera, but same result….

Any ideas ?

Y.


October 4, 2012 | 2:58 pm

how are you moving the camera? you should use the @camera of gl.render, or a jit.gl.camera object.


October 4, 2012 | 8:47 pm

I tried it with jit.gl.camera, inside my main patch.

But now I try to do it in the patch I posted… and it works…

I guess I have to have a closer look….

Thanks for the advise anyway !

I’ll be back if I can’t make it work ;))

– Pasted Max Patch, click to expand. –

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