jit.gl.sketch screentoworld

Oct 4, 2012 at 7:23am

jit.gl.sketch screentoworld

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. –
#64605
Oct 4, 2012 at 9:30am

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?

#233079
Oct 4, 2012 at 1:52pm

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.

#233080
Oct 4, 2012 at 2:58pm

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

#233081
Oct 4, 2012 at 8:47pm

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. –
#233082

You must be logged in to reply to this topic.