jit.gl.gridshape - independent colors per object?


    Jun 27 2006 | 4:13 pm
    Hello:
    I've been doing some work with jit.gl.gridshape using matrix input. I'm rendering multiple 3d spheres at once. It is quite easy (thanks to much help and a nice demo by Andrew) to manipulate many aspects of each of these spheres independently (e.g. scale, position, etc.), but I'm pretty sure that any color changes will be applied to all objects of a given jit.gl.gridshape.
    I'm just wondering if anyone knows of a way to manipulate color independently under these circumstances. Here is a more clear breakdown:
    Using various messaging combined with jit.poke, I feed a matrix (jit.matrix name 4 float32 32) with changing data, which is then fed into jit.gl.gridshape as various parameters. This gives me independent contol over many aspects of 32 GL spheres. The only problem is...any color messages apply to all 32 spheres.
    Can anybody spot a workaround? Right now I just have to use a different jit.gl.grishape for each color.
    Thanks in advance,
    Paul

    • Jun 27 2006 | 4:25 pm
      If you are using one jit.gl.gridshape object to draw multiple times with automatic=0, you can set the color differently for each sphere just like any other parameter.
      -Randy
      On Jun 27, 2006, at 9:13 AM, Paul wrote:
      > > Hello: > > I've been doing some work with jit.gl.gridshape using matrix > input. I'm rendering multiple 3d spheres at once. It is quite > easy (thanks to much help and a nice demo by Andrew) to manipulate > many aspects of each of these spheres independently (e.g. scale, > position, etc.), but I'm pretty sure that any color changes will be > applied to all objects of a given jit.gl.gridshape. > > I'm just wondering if anyone knows of a way to manipulate color > independently under these circumstances. Here is a more clear > breakdown: > > Using various messaging combined with jit.poke, I feed a matrix > (jit.matrix name 4 float32 32) with changing data, which is then > fed into jit.gl.gridshape as various parameters. This gives me > independent contol over many aspects of 32 GL spheres. The only > problem is...any color messages apply to all 32 spheres. > > Can anybody spot a workaround? Right now I just have to use a > different jit.gl.grishape for each color. > > Thanks in advance, > > Paul >
    • Jun 27 2006 | 4:29 pm
      You can change the color - you'll have to set "@automatic 0" and send a bang after sending the parameters for drawing each sphere, like "scale 1. 1. 1., color 2. 2. 2. 2., bang, scale 1. 1. 1., color 2. 2. 2. 2., bang"
      see:
      On Jun 27, 2006, at 5:13 PM, Paul wrote:
      > > Hello: > > I've been doing some work with jit.gl.gridshape using matrix > input. I'm rendering multiple 3d spheres at once. It is quite > easy (thanks to much help and a nice demo by Andrew) to manipulate > many aspects of each of these spheres independently (e.g. scale, > position, etc.), but I'm pretty sure that any color changes will be > applied to all objects of a given jit.gl.gridshape. > > I'm just wondering if anyone knows of a way to manipulate color > independently under these circumstances. Here is a more clear > breakdown: > > Using various messaging combined with jit.poke, I feed a matrix > (jit.matrix name 4 float32 32) with changing data, which is then > fed into jit.gl.gridshape as various parameters. This gives me > independent contol over many aspects of 32 GL spheres. The only > problem is...any color messages apply to all 32 spheres. > > Can anybody spot a workaround? Right now I just have to use a > different jit.gl.grishape for each color. > > Thanks in advance, > > Paul
    • Jun 27 2006 | 4:33 pm
      Hi Paul, Can you post your patch? Your message is quite confisuing as jit.gl.gridshape doesn't take a matrix input, so I'm not quite sure what you're talking about. You can in fact render multiple gridshapes using one object with different colors with messages. Just set it to @automatic 0 and set all the parameters you want to change and then send a draw message. Repeat for each bang to jit.gl.render for however many distinct gridshapes you want to appear.
      Alternatively if you're on OSX and want to use matrices with jit.poke~, you can download the new UB beta and use the jit.gl.multiple object to render many gridshapes at once with varying values for things like position, scale, color, texture, etc.
      best, wes
      On 6/27/06, Paul wrote: > > Hello: > > I've been doing some work with jit.gl.gridshape using matrix input. I'm rendering multiple 3d spheres at once. It is quite easy (thanks to much help and a nice demo by Andrew) to manipulate many aspects of each of these spheres independently (e.g. scale, position, etc.), but I'm pretty sure that any color changes will be applied to all objects of a given jit.gl.gridshape. > > I'm just wondering if anyone knows of a way to manipulate color independently under these circumstances. Here is a more clear breakdown: > > Using various messaging combined with jit.poke, I feed a matrix (jit.matrix name 4 float32 32) with changing data, which is then fed into jit.gl.gridshape as various parameters. This gives me independent contol over many aspects of 32 GL spheres. The only problem is...any color messages apply to all 32 spheres. > > Can anybody spot a workaround? Right now I just have to use a different jit.gl.grishape for each color. > > Thanks in advance, > > Paul >
    • Jun 27 2006 | 5:05 pm
      Thanks guys,
      The spheres are only a small part of a large and very messy patch (my first Max/MSP/Jitter project). I couldn't ask you to sort it out. However unclear my description was, you've managed to answer expertly. Thank you very much. My problem seems to have been with the message/bang ordering. I was getting weird constant flickering when I would change colors. I'll implement your advice and see what happens.
      Also, as you say, I mispoke when I called it "matrix input." I should have said that I was using a matrix to supply parameters for jit.gl.gridshape. Here is a breakdown of the flow:
      *multiple jit.poke objects-----> Matrix with 4 dimensions(x,y,z,scale)-----> jit.iter-----> messages (like position $1 $2 $3 and scale $4 $4 $4-------> jit.gl.gridshape)
      Sorry about that. Thanks for the help. If I have further questions, I'll be sure to prepare a smaller patch that demonstrates the issue at hand.
      Best,
      P