|
Rendering multiple GL Lines?I'm trying to put together a graffiti wall as part of a videowall installation I'm doing in a month or so's time. The idea is to take the TUIO information from the multitouch part of MSP Remote and feed that into a GL Line Structure patch to create a line. This is all working fine, but...it's all one continous line - because I'm just adding to the structure. If you take your fingers away from the remote and then try to start drawing somewhere else (for example, moving on to another letter), the GL Structure patch naturally draws a line from the last point to the new point. Now I could create multiple renderers and work out some twisty logic in the javascript patch to try and fudge a solution, but I was wondering if there's an obvious way of allowing discontinous lines that I'm missing...
|
Double up end end points, and set the Line type to "Line Segments" -- instead of P0, P1, P2, P3 in the structure, have P0, P1, P1, P2, P2, P3.. -- it's a little more difficult, but it'll let you draw several separate segments without needing to render multiple structures.
Aha! Thanks! Seems to be working out quite well :).
hi ian can you tell me how you accomplished this? i can't seem to duplicate a strucuture member i am getting kinda numb...
Is there an OpenGL performance hit to doubling-up points in this way? I'm assuming there will be some structure-related slowdown, too.
a|x
oh well i wont mind if it passes from 100fps to 60fps :) still need some help thanks
so how can i export a point with P0, P1, P1,P2,P2,P3,P3... and so on?
my example uses the javascript push function, but it pushes all the points... please help
some code:
getting kinda lonely here but i got what i wanted i guess but still no work... anyone? thanks bern
well I get this from your code, see attached, and you're wanting to be able to put out multiple structures concurrently, why not just make multiple structure outputs?
i am trying to create a 2d array that stores the previous line and the next one on a new structure... kinda pen up stops line pen down starts a new line
plus i get this for an error:
I think that either you are on Leo or you are needing to refresh your frameworks from installation disk , plus appropriate update on Snow Leo.
The composition calling for queue structure in parallel is requiring that their be a patch of that name in your Library and its SL only.
thanks cybero... yes i am in leopard winter hasn't arrived on this side... keep searching....
I think you might need to copy and paste the code form inside the JS patch into a new JS patch and then connect that up, must be the indexed name that has been changed or something that results in perfectly good JS that must have been working after a fashion for you on Leo to then not work when returned from a Snow Leo user.
I just built my example up using GL patches a Script patch, a Mouse patch, a Keyboard and an Interpolator. The Queue Structure in Parallel was unconnected to anything, its the JS disconnection situation that has me a trifle baffled.
I say this because this won't work in Leo runtimes and the error is the same JS error you've gotten, neither 32 nor 64 bit runtime works without error.
I've taken out the offending item and re-saved the file, if it provokes the same error, then try the workaround suggested above, or something similar.
Does that JS work for you in Leo?
Hmm, that runs in Leopard, but it doesn't make separate lines...
For instance, you have pressure attached to x position... so mouse up and down can't possibly generate anything meaningful (?).
I am probably missing something on this one, I haven't totally read the whole thread. I haven't tried it in SL either.
LOL - must be needing some new glasses.
yeah but i guess you're are in the right path... but still no go too here in leo mode waiting for the snow though
still trying though
ok trying the path of 3d arrays
Ohhh, I think this is the topic I was thinking of when posting on another thread. If you feed a queue a nan value, the line will break, allowing you to create another segment that isn't "connected" to the first. This is an "auto" demonstration, but it would be easy enough to setup the mouse patch w/ a multiplexer so that nan is fed to an input when there is no keypress.
NICE!
even nicer is when nan is the same as NaN