Oleg,
Yes! Thank you. This is what I was looking for. The
delay foreign works on the Mac as well. The key seems to be
that the gl2 verb glpaint recognizes the J delays. (Notice
that glpaint is distinct from gspaint.)
Your examples relied on the demo's gspaint verb. The
demo's rely on several global nouns and a verb paint which
manages rotation and position of the viewing camera relative
to the modeled object(s). These demo verbs are very slick
and greatly facilitate keystroke revisions of the camera
viewing position.
My verb go only changes the background color in this
simple example, not the viewing angle. It could have
controlled movements like forward (translation) and right
rotation) of a modeled object. I am including below the
revised script. To see it work do the following.
0 Load the script in the .ijx window (I learned that is
called the session manager from your post)
1 run''
2 go go go''
You should see the background color change and the
triangle remain black and in its same position.
PS. I would like to know how the verb run could be altered
to place the focus in the session manager at its exit.
(B=)
NB. delay.ijs for J601
NB. patterned after:
NB. system\examples\graphics\opengl\lab\ogl1.ijs
clear'' NB. clear base locale
require 'opengl gl2 gl3'
coinsert 'jgl2 jgl3'
delay =: 6!:3
DELAY =: 1
GL3LAB=: 0 : 0
pc gl3lab closeok;
xywh 0 0 100 100;cc g isigraph rightmove bottommove;
pas 0 0;
rem form end;
)
run=: 3 : 0
wd GL3LAB
ogl=: ''conew'jzopengl'
wd'pshow;'
HWNDC=: wd 'qhwndc g'
HW =: glqwh''
alloc__ogl HW
CLEARCOLOR =. 4#1
glClearColor CLEARCOLOR
glClear GL_COLOR_BUFFER_BIT
draw__ogl''
empty''
)
go =: 3 : 0
alloc__ogl HW
CLEARCOLOR =. ?4#2
glClearColor CLEARCOLOR
glClear GL_COLOR_BUFFER_BIT
glOrtho _1 1 _1 1 _1 1
glColor3d 0 0 0
glBegin GL_POLYGON
glVertex 1 ,0 ,0,1
glVertex 0 ,0.5 ,0,1
glVertex _1 ,0 ,0,1
glEnd ''
draw__ogl''
delay DELAY NB. here is the delay
glsel HWNDC
glpaint''
)
On Sun, 23 Apr 2006, Oleg Kobchenko wrote:
+ Immediate steps without timer for j601 beta k or l:
+
+ - Run the OpenGL demo, select desired model
+
+ - Type or paste into session manager and execute line by line:
+
+ g_z_=: 2 : '(6!:3 bind n)@[EMAIL PROTECTED]' NB. verb g delay
+ cocurrent'jgldemo'
+
+ (0&gsrotate bind 2) g 0.2^:10''
+
+ go=: (0&gsrotate bind 5) g 0.5
+ go go go''
+
+
+ - Select Soccer Ball model
+
+ g1=: (gstranslate bind 0 0.5 0) g 0.5
+ g2=: (0&gsrotate bind 5) g 0.5
+ g3=: (gstranslate bind 0 _0.5 0) g 0.5
+
+ g1 g2^:3 g3^:2 g2^:3 g1''
+
+
+
+
+ This produces visible steps of changes.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm