Kineme GL Lines Structure Parametrs

idlefon's picture

Hi everyone!

I'd like to know if all of the Line Structure patch's parameters can be tweaked by the input structure. I know it works for the Point Structure patch , for instance if you send a structure with a R/G/B/A member you can change the color of each point. I couldn't do the same with lines though! It will be sweet if one can change "Size", "Color1", "Color2",... for every line.

Cheers for your help!!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: Kineme GL Lines Structure Parametrs

You could create a structure containing the member types you want and then only get the x,y,z for the input lines and pass the changing values to the point colour, size as required, by key.

I may well be missing something, but that seems to be the only way that you can affect the RGBA of the point or line colour with those values all derived from a structure. Both of those Structure patches only accept x.y.z structures, yes?

& having said that, there probably is some way of doing what you are asking after, but it seems to me that unless they are all apprehended as the Line or Point Structure input all at once, then they are going to need to be split apart at some point.

idlefon's picture
Re: Kineme GL Lines Structure Parametrs

The method you proposed in the first paragraph is exactly what I'm avoiding, since it makes all the lines/points have the same color/size.

I attached an example comp which shows that the Point Structure Patch accepts it's color via the structure (you can change the colors individually) but the Line Structure Patch does not act similar.

What I'm doing now is that I make an iterator, send the structure and read every line's size/color via the Key Member Patch and have them act individually but the thing is that since my Method uses iterators it's really slower than the Kineme Structure thingys :D

My question is if I can do the same thing I''m doing with point structure with the line structure and if not only color but the other parameters can be tweaked through with input structure.

PreviewAttachmentSize
Point structure accepts R:G:B etc..qtz12.07 KB

cybero's picture
Re: Kineme GL Lines Structure Parametrs

Well I was definitely missing that, even though either Named Structure or a JS could provide the sort of structure I was speaking of. In fact this has probably been pointed out before now , I just hadn't quite twigged to it till now.

jersmi's picture
Re: Kineme GL Lines Structure Parametrs

maybe like attached pic? this would require 3 more structure members for separate line color 1 / color 2. Also, using the line structure patch means you can't do that nice calligraphic size change like in the iterator....

PreviewAttachmentSize
Screen shot 2011-01-29 at 11.36.07 PM.jpg
Screen shot 2011-01-29 at 11.36.07 PM.jpg95.47 KB

idlefon's picture
Re: Kineme GL Lines Structure Parametrs

Thanks jersmi but the what you did in the pic is not any different from changing the Color of the line structure directly. This as I mentioned before will change all the lines' colors. I'm after doing this independently for each line.

I guess we should wait for cwright or smokris (the creators of these wonderful patches) to enlighten this matter. whether this feature is already implemented or will it ever be?

cybero's picture
Re: Kineme GL Lines Structure Parametrs

That's the kind of approach I was speaking of, Kineme Structure Tools [very useful]

gtoledo3's picture
Re: Kineme GL Lines Structure Parametrs

The GL Line can't be addressed that way, and it's known.

You can emulate that with a GL Quad, and it may be better overall, because when you move it back and forth in Z the created line will change thickness. That doesn't happen with GL Line (or the stock Line).

OpenCL/Mesh creator lets you make a line and specify color for each segment as well.

idlefon's picture
Re: Kineme GL Lines Structure Parametrs

GL Quad Structure is definitely what I've been looking for. Thanks George!

I have two questions though:

1- As you know for making a quad similar to a line (in Quad strip mode) you'll need 2 extra points in your structure. for instance when you draw a line from you'll need (0,0) and (0,.5) but when you're drawing a quad you'll need (-.1,0),(.1,0),(.1,.5),(-.1,.5).

Isn't this process heavier on the GPU than the line method. I'm asking this because my composition is a heavy one.

2- what are the NX,NY,NZ for in the structure?

Cheers George!

cybero's picture
Re: Kineme GL Lines Structure Parametrs

q1 - don't know, don't think it's especially crucial, but I might be wrong :-).

q2 - aren't they underlying quad grid measures?

gtoledo3's picture
Re: Kineme GL Lines Structure Parametrs

That's true, but when you make a thick line, it looks kind of weird (to me), when it has a sharp angle. A GL Line doesn't really attenuate as it moves back or forth in a scene, and there's no real mechanism to make it do so... if you tried to emulate it (like happens with Kineme GL Points), it would look kind of funky, because of start point and end point are really far apart in z...you would have to kind of weight the line oddly.

I don't know, that may not be a concern at all...it's just come up before on projects, and I've taken note. If you have a quad strip, or triangle strip though, it will look bigger or smaller as depending on Z.

NX,NY,NZ are for normals in the structure... which is pretty easy to call in OpenGL (I'm guessing why it's in there?), but not as easy to actually calculate. Calculating them in javascript is probably inefficient. I wouldn't worry about it a bunch unless you just had to have lighting effect on a line (at that, there wouldn't really be the kind of polycounts that make gl lighting look more even and quality).

I happened to be messing around with something else entirely... rendering GLUT shapes, and I wasn't too far off from making structure renderers with the coloring that's missing from gl line struct and gl point struct, but are analogous otherwise. I'm going to post them in a minute or so.

jersmi's picture
Re: Kineme GL Lines Structure Parametrs

GT, could color structures for the mesh creator work? Seems this could help the cause, too, but i am just looking into this. If so, any advice or relevant posts from your blog, etc.? I do like the mouse ribbon method with the mesh triangle strip for nice lines with a calligraphic style and variable line width in z.

gtoledo3's picture
Re: Kineme GL Lines Structure Parametrs

It's possible to send color structure to the mesh creator; you send a 4-lane structure, similar to how you use the vertices input. Somewhere around here I have a "meshdraw" stock QC SL composition that does this (hmm, just realizing mesh draw is the most unoriginal name ever...even I'm reusing it for multiple things).

I posted a "meshdraw" plugin that has some kind of pleasing settings, but I haven't built a color structure into it yet. I'm planning on it, and it won't break anything for anyone who has used it. That's kinda cool because of some of the modes available.

GLQuad Structure can do keyed color struct... it doesn't have anything like "line" thickness that's tweakable at the renderer though. It's funny how sometimes there is major overlap, but one difference in feature makes all the world.

FWIW, I did just post versions of the point struct and line struct that take keyed colors in a new forum thread, which hopefully helps idlefon's quest.