You need some access to gl2.ijs too, for for the sake of completeness"
coinsert 'jgl2'
require 'trig gl2'
dawin=: 3 : 0
0 0 1 1 1 dawin y
:
'a c b d e'=.x
SC=:WIN_WH&*@((-&(a,d)) %((b-a),c-d)"1)"1
sz=.":WIN_WH
PN=.y,'; Animation window bounds are x: ',(":a),' to ',(":b),' y:
',(":c),' to ',":d
nx_WIN ''
z=.'pc ',WIN_nam,' closeok;pn "',PN,'";minwh ',sz,' ;cc g isidraw;'
wd z,';pshow;'
glclear''
DELAY=:e
)
dfillcolor=: 3 : 0 NB. Start Fill Color
wd 'psel ',WIN_nam
if. _1 e.y do. glbrushnull ''
else. glrgb y
glbrush''
end.
)
NB. ------------------------------------------------
NB. dapoly v Displays animated list of 2-D polygons
dapoly=: 3 : 0 NB. Show polygon
0 0 0 dapoly y
:
if. (1=$$x) do. X=.(#y)$,:x else. X=.x end.
Y=.x:^:_1 SC 2{."1 y
wd 'psel ',WIN_nam
k=.0
while. k<#y do.
glclear ''
dfillcolor k{X
glpolygon ,k{Y
glpaintx ''
delay DELAY
k=.>:k
end.
)
nx_WIN=:3 : 0
try. WIN_num=: WIN_num + 1 catch. WIN_num=: 0 end.
WIN_nam=:'p',": WIN_num
)
delay=:6!:3
WIN_WH=:500 500
sq=:#: 0 1 3 2
_2 _2 2 2 0.1 dawin 'rot'
rot=:(cos,sin),:-@sin,cos
R=:(rot 1r40p1)&(+/ . *)"1
$pl=:R^:(i.120) sq
0 255 0 dapoly pl
On 4/26/2015 6:47 PM, Cliff Reiter wrote:
nx_WIN=:3 : 0
try. WIN_num=: WIN_num + 1 catch. WIN_num=: 0 end.
WIN_nam=:'p',": WIN_num
)
On 4/26/2015 5:54 PM, Raul Miller wrote:
I get a value error on nx_WIN
Thanks,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm