Turn 2D Poly into a 3D poly extruded

Started by Hardcoal, December 16, 2019, 13:23:26

Previous topic - Next topic

Hardcoal

hi.. i once programmed such a thing but.. i kinda lost the code..

Anyone has a code to turn 2d poly coords into a 3d volumatic mesh?
If not ill just have to redo it again..
Code

_PJ_

There was some B3D routine for this on the old Blitzbasic archives (so it ought to have been ported over here?). I think it assumed the 2D poly was on a plane and extruded fixed-height 3rd dimension from this.

I will dig out that old code later if you don't have another answer by then.


Hardcoal

Great man..
if not.. it wouldnt be too hard to remake I beleive :)
Code

_PJ_

Yeah I think something like jsut checking for polygon vertices in the 2d plane from which to extend a normal which marks an edge towards the 3rd dimensional vertex. This would give you a series of serrated triangles which can be paired with similar triangles.

If you're only dealing with convex polygons, you could create a cylinder and modify vertices at the "ends" accordingly.