Polygon Surface

About advanced scenes, and the Thyme scripting language used in Algodoo.

Polygon Surface

Postby Rideg » Fri Feb 18, 2011 11:01 pm

How does the surface system work when spawning a polygon? :?:
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Polygon Surface

Postby Kilinich » Sat Feb 19, 2011 12:48 am

You mean "surfaces" data? It's a list of sub-polygons where each sub-polygon is list of points.
For example if you need to spawn box with triangle hole in the middle you need that surfaces:

[[box],[triangle]]

[[[0,1],[1,1],[1,0],[0,0]], [[0.1, 0.1], [0.9, 0.1], [0.5, 0.9]]]

Code: Select all
scene.addPolygon {surfaces := [[[0,1],[1,1],[1,0],[0,0]], [[0.1, 0.1], [0.9, 0.1], [0.5, 0.9]]]}
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests