Forums > Jitter

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

March 17, 2009 | 1:21 pm

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


March 21, 2009 | 11:56 pm

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.


March 22, 2009 | 2:02 am

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.


March 22, 2009 | 3:57 am
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.


March 22, 2009 | 5:59 pm

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

March 22, 2009 | 6:38 pm

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

– Pasted Max Patch, click to expand. –

March 22, 2009 | 7:40 pm

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?


March 22, 2009 | 9:56 pm

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.


March 22, 2009 | 11:36 pm

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

Jamie


March 25, 2009 | 7:12 pm

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


March 25, 2009 | 7:51 pm

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.


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