Notifications
Clear all

[Closed] why???!! gw.triangle canot fill the color?

 fn testDrawTri =
(
	gw.setTransform(Matrix3 1)
	gw.startTriangles()
	gw.triangle #([0,0,0], [50,0,0], [50,50,0]) #(red,red,red)
	gw.triangle #([0,0,0], [50,50,0], [0,50,0]) #(green,green,green)
	gw.endTriangles()
	gw.enlargeUpdateRect #whole 
	gw.updateScreen()
)
RegisterRedrawViewsCallback testDrawTri
UnRegisterRedrawViewsCallback testDrawTri 

4 Replies

photo for execute code after

how to using gw.polygon?
why, none display


 fn TestDrawPoly = 
(
	gw.setcolor  #fill green
	gw.polygon  #([0,0,0], [0,100,0], [100,0,0]) #(red, blue, green) #([1.0,.5,0], [0.5,0.5,0], [0,0,0.5]) 
	gw.enlargeUpdateRect #whole 
	gw.updateScreen()
)
 
RegisterRedrawViewsCallback TestDrawPoly
UnRegisterRedrawViewsCallback TestDrawPoly 

both code samples work fine here – try switching to the Software viewport display driver… if it works with that for you, then it’s a driver-related issue.

thanks,
i execute this code in software,can display poly…