I think you're assuming 2d turtle, here? (Which might be a correct assumption?)
Thanks, -- Raul On Fri, Feb 14, 2020 at 7:19 PM bill lam <[email protected]> wrote: > If you intended to run turtle graphics only, then drawing cube is over > skilled. Drawing triangles is much simpler. eg a triangle with vertices > 0 1 0, 1 _1 0, _1 _1 0 > then use different scale, translate and rotate to place them into different > positions and orientations. > > Also only a constant solid color from fragment shader is sufficient. > > On Sat, Feb 15, 2020, 7:19 AM Brian Schott <[email protected]> wrote: > > > Raul, > > > > Yes, you are a big help. > > > > However, you say that the only geometry to update in shader is R, but I > > don't think so. LR (left and right) is also explicitly updated, and IO > (in > > and out) and UD (up and down) could potentially be updated. R is likely > > updating the heading of the turtle, but earlier I was musing about > whether > > it was updating the heading of the (viewing) eye. With only one turtle > and > > one eye, it does not matter much which is correct, but with multiple > > objects (turtles (and eyes?)) things get more complicated. > > > > Consider the initial state of the system eye here (where EYE=: 0 0 1 and > > LR=: UD=: IO=: 0) > > AND before R has been applied: > > > > glu_LookAt EYE,LR,UD,IO,UP > > 1 0 0 0 > > 0 1 0 0 > > 0 0 1 0 > > 0 0 _1 1 > > (gl_Translate 0 0 _8) mp glu_LookAt EYE,LR,UD,IO,UP > > 1 0 0 0 > > 0 1 0 0 > > 0 0 1 0 > > 0 0 _9 1 > > > > glu_LookAt=: 3 : 0 > > 'eye center up'=. _3]\,>y > > F=. center - eye > > f=. (% +/&.:*:)F > > UPP=. (% +/&.:*:)up > > s=. f ((1&|.@:[ * _1&|.@:]) - _1&|.@:[ * 1&|.@:]) UPP > > u=. s ((1&|.@:[ * _1&|.@:]) - _1&|.@:[ * 1&|.@:]) f > > M=. _4]\ s, 0, u, 0, (-f), 0 0 0 0 1 > > (|:M) gl_mp~ gl_Translate -eye > > ) > > > > See, the Eye is 9 units above the cube, I think. (I'm not sure about 9, > but > > I guess 9 because > > we see "F=. center - eye" in glu_LookAt.) > > > > Next the view (or the object) is scaled and rotated in the calculation of > > mvp. > > > > So I am thinking for 1 eye and n-1 turtles there needs to be n mvp's, n > Rs, > > and n LRs, n UDs, and n IOs. (And I don't think n-1 turtles makes any > real > > world sense, either.) > > > > Do you agree about needing so many mvp's and LRs and so on? > > > > > > > > On Fri, Feb 14, 2020 at 5:06 PM Raul Miller <[email protected]> > wrote: > > > > > On Fri, Feb 14, 2020 at 4:15 PM Brian Schott <[email protected]> > > > wrote: > > > > I am mostly interested in how commands in the Terminal window can be > > sent > > > > to the Cube in the "a" window. Any pointers? > > > > > > There's two parts to the answer to your question, in the context of > > > shader.ijs > > > > > > (1) Update the geometry being rendered, > > > (2) call gl_paint'' > > > > > > In shader.ijs, the only geometry being updated is the value of R -- > > > the rendering of that geometry is all the details that you see in the > > > implementation of a_g_paint (mostly the bits involving mvp). > > > > > > For what you're describing, you might want (for example) a lot of > cubes. > > > > > > I hope this helps, > > > > > > -- > > (B=) > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
