Thomas, I agree with Bill that this is a great step forward in understanding how to use opengl.
My main interest is in doing a turtle graphics app which enables multiple turtles to appear on the screen. In the previous version I had to keep track of the position and heading of each turtle for each of the user's moves. I am mostly thinking of your use of glu_Lookat to translate the turtle and rotate the turtle. I am toying with the idea of replacing the Eye in glu_Lookat with the current turtle's heading. But I really need to think about this more and could use any ideas you have. Of course I am still struggling with painting the faces of the tetrahedrons as solid colors. They are my tentative turtles. I am now wondering if my problem is related to the use of four-element color vectors instead of three element. I have not found any description of how to set those things in the kernel as you seem to have done. And does this setting conflict with the attribute setting that I changed from 3 to 4? (B=) On Fri, Feb 28, 2020, 5:03 AM Thomas McGuire <[email protected]> wrote: > At first I thought I would have to. But after doing some searching on > shaders and OpenGL it turns out that if you don’t mind using the same > shader, you can just send multiple objects in and different model-views > into the original kernel (the GLSL code you are referring to). > > It gets a little crazy because the cube drawing program has similar names > for things that are represented in different worlds so to speak. > > The kernel: > #version 120 > #define lowp > #define mediump > #define highp > attribute highp vec3 vertex; > attribute lowp vec3 color; > varying lowp vec4 v_color; > uniform mat4 mvp; > void main(void) > { > gl_Position = mvp * vec4(vertex,1.0); > v_color = vec4(color,1.0); > } > > [Snip] ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
