How to make work gw.hpolygon?

Example from maxscript reference:

-- Draw some primitives 
gw.hPolyline #([300,50,16], [300,200,8], [450,250,4]) true 
-- 
gw.hPolygon #([200,100,16], [280,100,8], [250,200,4]) \ 
#(red, blue, green) \ 
#([1.0,.5,0], [0.5,0.5,0], [0,0,0.5]) 
-- Update the viewports 
gw.enlargeUpdateRect #whole 
gw.updateScreen()

Supposed to draw line and polygon, but only line is drawn. The only way I was able to see poly, was switching to software rendering, which is not an option.

So, how to make gw.hpolygon work with DX rendering?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
luzegras's picture

like this?

unRegisterRedrawViewsCallback li

fn li =(

gw.hPolyline #([300,50,16], [300,200,8], [450,250,4]) true
--
gw.hPolygon #([200,100,16], [280,100,8], [250,200,4]) \
#(red, blue, green) \
#([1.0,.5,0], [0.5,0.5,0], [0,0,0.5])
-- Update the viewports
gw.enlargeUpdateRect #whole
gw.updateScreen()

)

registerRedrawViewsCallback li

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.