symdat <'vertexData' is a pointer to the data (not header). If you want to update without re-assigning the name, you could do something like
p=. symdat <'vertexData' d=. 1&fc (new vertex data) d memw p,0,(#d),2 but beware of any side effects Tue, 03 Mar 2020, Brian Schott написал(а): > All, > > Recall that I am (re)developing a multiple turtle, turtle graphics system > using modern openGL. I have been unable to find examples of how to do this, > and the examples that come close use C++ and GLM which hide from me some of > the essentials. What follows is my current understanding of how I might > proceed. I want advice, please. > > Consider the "model-view" line (just below) for transformations in > shader.ijs. (The "Projection" line immediately after the "model-view" line > in the code is not relevant to my comments.) > > NB. model-view (*********line wrap is bad here********) > mvp=: (gl_Rotate (0{R), 1 0 0 ) mp (gl_Rotate (1{R), 0 1 0) mp (gl_Rotate > (2{R), 0 0 1) mp (gl_Scale STEPS%100) mp (gl_Translate 0 0 _8) mp > glu_LookAt EYE,LR,UD,IO,UP > > But I do not think that "model-view" line can be used effectively in a > turtleS (plural) graphical system because the calculation is really moving > the system camera (I call it the Eye) so it can focus on a specific target > in the scene. > > I believe, but want to proved wrong, that instead each turtle has to have > its own vertexData array and that array must be rewritten after each > position or heading change. It is possible that only turtles that do so > move require a change of their vertices and position. Furthermore, a > separate current heading matrix and gl_Position for each turtle must be > computed and stored after each rotation and translation, respectively. > > I may be wrong about gl_Position above, because that special value may be > associated with the camera and not with the individual objects. Does anyone > know about that? > > If I am correct that each turtle's moving or turning vertices have to be > altered, I believe I understand how gl_Rotate and gl_Translate can be > applied to vertices to generate knew vertices, and how a new 3x3 heading > array can be computed after each rotation and how revised position vectors > can be computed. Saving the heading array and the position vectors may be > more efficient in j than in openGL, but I have not thought that through. > > It seems to me that it might be very desirable to save the revised > vertexData vertices in their original location so that the pointer in > "symdat <'vertexData'" can be used without rebinding the vector buffer. But > I have no idea if or how that might be done. Help, please. > > Any help on these issues would be greatly appreciated. > > -- > (B=) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm