jit.gl.mesh inputs

May 11, 2011 at 2:40pm

jit.gl.mesh inputs

Hi all,

i am wondering how to use the different jit.gl.mesh inputs, it is quite vague to me what the inputs do exactly. I know i can use the matrixoutput of a jit.gl.gridshape for instance, but i want to have a better understanding of these inputs since i feel i should be able to use the object in a more advanced way. At the moment i experience crashes when experimenting with the inputs though ;)

thanks for your help.

best regards

roel van doorn

May 11, 2011 at 2:41pm

should move this to Jitter forum, apoligies

May 11, 2011 at 6:08pm

Hi Roel

Through input 1 you pass the xyz position of the vertices (in the form of a 3-plane float32 matrix, where plane 0 are x positions, plane a are y positions and plane 2 are z positions)

Through input 2 you pass texture coordinates for each vertex. This is only necessary when you want to map texture in a special way. Usually you will use 2D textures that need a 2-plane float32 matrix (x and y coords).

Through input 3 you pass normal information for each vertex, in the form of a 3-plane matrix. Normals are vectors used to make lighting calculations. More on normals here: http://en.wikipedia.org/wiki/Surface_normal

Through input 4 you pass color information: which color your vertex will be colored with. Later on , the fragment part of the GL pipeline will generate interpolation between vertices so that you can see smooth transitions.

Through input 5 you pass specular information, meaning the grade of specular component (how bright) is each vertex in relation to the light source.

Through input 6 you pass edge flag information, which I don’t know exactly what is, but I think it has to do with the way polygons are rendered in a shape. More info here http://www.talisman.org/opengl-1.1/Reference/glEdgeFlag.html

Inputs 7 and 8 serve to input tangent and bitangent info, which as far as I know can also be used for lighting calculations

And index 9 is used to input the index array of the vertices…which I guess must serve to determine the orde in which the vertices are rendered and related to each other. But I’m not sure about this last one.

Hope this helped in some way


May 13, 2011 at 12:09pm

Thanks so much, i will begin testing with this info right away. The edge thing is still a bit vague for me as well, i also came across these edge values in the jit.gl.slab object, but have no clue what it does exactly. Well, first i will try to make some basic shapes.

Thanks again, i checked your website by the way, looks very nice!

May 13, 2011 at 5:18pm

Hey Roel
Thanks! Yeah, the edge flag thing is pretty advanced stuff, you can check the OpenGL “Red Book” p.p. 62-63 to know more about it. Also you can read this book online (look for glEdgeFlag)


Succes, en graag tot ziens! ;)


You must be logged in to reply to this topic.