rendering colours to a 3d object in jit.gl.gridshape?

Mar 17, 2009 at 1:21pm

rendering colours to a 3d object in jit.gl.gridshape?

Hi all,

Im relatively new to jitter and Im trying to render different colours to each side of a 3d cube using jit.gl.gridshape

Im using the cv.jit externals in order to make an intactile interface for musical interaction, which includes a rotating cube, but it would be nice if each of the sides were a different colour in order to tell which side is manipulating which audio sample.

Could anyone direct me to a suitable way of doing this? I have tried a few ways but the colours stay stationary while the cube rotates. Whereas, I need the colours to be locked to each face.
Please have a look at my research site at alexanderthomas.wordpress.com for an example of the patch

Any help would be greatly appreciated

Many Thanks

Jamie

http://www.alexanderjamiethomas.co.uk
alexanderthomas.wordpress.com

#42895
Mar 21, 2009 at 11:56pm

Hello every one. Could anyone please help me with this, as im sure its not a complicated thing. I have a demo on monday, and im getting a bit shaky about presenting it. would be really cool if anyone could help me out.

Thanks in advance.

#153573
Mar 22, 2009 at 2:02am

probably easiest to create 6 planes and position and rotate them in the shape of a cube. then you can color each face differently.

post a patch of your work in progress if you need more help.

#153574
Mar 22, 2009 at 3:57am
alexanderthomas wrote on Sat, 21 March 2009 18:56
Hello every one. Could anyone please help me with this, as im sure its not a complicated thing. I have a demo on monday, and im getting a bit shaky about presenting it. would be really cool if anyone could help me out.

Thanks in advance.

yeah make six planes in the correct position and rotation, then use a jit.gl.handle to rotate/position/scale the entire scene by sending it to jit.gl.render.

#153575
Mar 22, 2009 at 5:59pm

Hi guys,

Thanks a lot for the suggestions. I have made the cube as directed, with really good results. Although I have encountered another problem. Whereas before I could have a live video input and the cube in the same window each being controlled separately (gridshape + render) so that the cube could be rotated without the image rotating also. Now due to cube being sent to .render also this is not possible. Is it possible to get the cube to rotate while the video input stays fixed in the background?

Here is the patch.

Thanks for the help so far, it is much appreciated.

– Pasted Max Patch, click to expand. –
#153576
Mar 22, 2009 at 6:38pm

this is how i would do it, utilizing gl.sketch to group the gridshapes together…

– Pasted Max Patch, click to expand. –
#153577
Mar 22, 2009 at 7:40pm

Hi robtherich,

Thanks for getting back to me. I can see how this could be a way around the problem. although I cant seem to get anything out of you patch. I get a grey window. Have I missed something?

#153578
Mar 22, 2009 at 9:56pm

that’s just one face of the cube filling up the window.
just use the handle to push the object back by dragging up on the window holding down the option key.

#153579
Mar 22, 2009 at 11:36pm

Ahh, Ive got it. That works great now. Thank you very much.

Jamie

#153580
Mar 25, 2009 at 7:12pm

have you tried using [jit.gl.cubemap]? this object will map a separate texture to each side of your object.

#153581
Mar 25, 2009 at 7:51pm

yes, cubemap is an option. however i don’t think for this situation it is the best solution. cubemap is for specific textures that combine to form a seamless “scene” surrounding and reflecting on a 3D object. if you use cubemap with solid colors, every time you move or rotate the object, the faces of the cubemap will no longer line up with the faces of the 3D cube.

#153582

You must be logged in to reply to this topic.