Code to extrude 2d geometry to 3d
is there any simple way to extrude a 2d geomtry (vectors ) to a 3d shape
assuming extruding parameter are lenght (double) and angle (degree)
so it should render like a cone ( all z lines going 开发者_开发知识库to one point )
(I'd make this a comment, but it's too big)
This isn't just an extruding problem
If it were, your original 2D image would produce either a cylinder with a series of holes in it (not really that useful unless you have a very sophisticated renderer doing either volumetrics or supporting transparency, and the polysort in that case would be very ugly) or 4 cylinders (if I extrude along the inner holes)
most extrusion algorithms don't deal with targeting a single point - that's more than extrusion, it's some form of raycasting
This looks suspiciously like a lighting issue - are you trying to do volumetric lighting, maybe show an effect where the light cone is and deal with the effect of a baffle in front of the light ? Or are you trying to compute the geometry that would define the shadow cast by the object in front of the light ?
精彩评论