determine colors and invisible "handles" in jit.phys environment


    Jul 15 2016 | 5:13 pm
    before moving forward with this patch (below) I would like to resolve a couple of things. Any help / guidance is much appreciated.
    first, I have 100 spheres, and I would like to make 25 of them color#1, 25 of them color#2, 25 of them color#3, 25 of them color#4
    also, I would like to make the "handles" on the spheres invisible
    also interested in any other ideas/directions for improvements
    thank you!

    • Jul 15 2016 | 6:26 pm
      you can use the builtin scanwrap functionality of jit.gl.multiple to do you your colors, simply passing in a 1D 4 cell matrix to the color input, but you have to restructure your position matrix slightly.
      for hiding the body handles, simply disable gl.physdraw, or set @draw_bodies 0
    • Jul 15 2016 | 8:13 pm
      Rob,
      as always, thank you much for the concise and useful answer plus patch.
      using the jit.noise object leaves me with one further question,
      how would I control the four colors?
    • Jul 15 2016 | 8:38 pm
      my pleasure.
      change it to jit.matrix and use the setcell message: setcell 0 val 1 0 0 1, setcell 1 val 1 1 0 0 ... etc..., bang
    • Jul 16 2016 | 11:13 pm
      after poking at this for an hour or so I have to admit I don't know how to do what you're suggesting. not sure what I'm doing wrong, having a difficult time finding any documentation that clarifies any help is appreciated
    • Jul 18 2016 | 3:57 pm
      you needed to provide a final arg setting the number of cells, and you need to bang the matrix after setting the values. basic jit.matrix stuff, so make sure you look at jitter tutorial #2 if this doesn't make sense.
    • Jul 18 2016 | 5:15 pm
      Thanks again, Rob. Really appreciate your generosity.
      Read through Jitter Tutorial #2 again. I often understand the principles within the tutorial, and then have a difficult time applying them to the specifics of my patch(es).