In this thread in its original post (to which I am replying here), I was not able to view old turtle path lines when new lines were added. Raul correctly pointed out a property of canvas, preserveDrawingBuffer (pDB), that preserves the old lines and shows the new lines, too.
However, because there are some other features in webg; 3D canvas rendering which only work with pDB set to false, I have found ways to send all of the paths via ajax, not just the new lines, each time an update occurs. That does not seem very efficient, but I really want the other features, one of which permit the whole drawing to be rotated or zoomed according to user requests and these features are undermined by pDB being true instead of false. I have implemented a version of this app that does send the whole history of paths and turtles every time and have not tested the time or the stack growth, but this may be the only viable alternative. http://www.jsoftware.com/jwiki/BrianSchott/code/turtleGraphics/tgsjhs http://youtu.be/eb6d9KbStM0 (0) A major issue of tgsjhs is that there are 2 conflicting drawing modes used. One of the modes is the original one where the arrow keys are used to reorient the viewer's viewpoint. This mode is very desirable, but there are at least two problems: not only does the use of the arrow keys erase the turtle drawing temporarily, but I like to use the left and right arrow key often in the text field to edit the entry slightly, but now the arrow keys cannot be used for that. So I would really like ideas for fixing these 2 problems. For example is there a way to ignore the arrow key that is used in the graphic while the focus is in the text field? I can always recover the turtle graphics screen by entering a do-nothing movement or turn command like fd 0 or rt 0, but another idea is to add one of those do-nothing commands to the javascript draw() function so that each such refresh is followed by a turtle images/paths refresh. A problem with this idea is that already each time the turtle moves or turns, drawTurtles() is called and it already calls draw(), so wouldn't that produce an endless loop, which I do not know how to break out of. Other niggling problems that I have no solution for are the following. (1) I have implemented a 3-frame browser page like the one in JHS demo9.ijs but it is not pretty. What I would most like to do is correctly add an automatic J command in jijx frame that makes the locale cocurrent 'tgsj' . (2) The lighting does not work well when I turn the js variable lit to 1, so I have turned off lighting. I suspect the problem is related to a webgl feature called CULL_FACE, but I am not sure. (3) Does it make sense to send the whole history of paths each time the system is updated by the user, or is there some way to save the history in javascript or html, for example? Thank you, -- (B=) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
