jondinham
jondinham

Reputation: 8499

How to create solid extrusion of bitmap with OpenGL?

I have a bitmap image (RGB, no alpha), like the image below (letter 'R'):

enter image description here

Which is the best way, with OpenGL & VC++, to create the extrusion of the bitmap? Parameter is a 3f vector. Either solid extrusion or surface only extrusion is ok.

Any idea?

Upvotes: 1

Views: 869

Answers (2)

jondinham
jondinham

Reputation: 8499

I have one solution, but it utilises the texture 3D feature to make solid extrusion so it is truely slow:

"Duplicate the bitmap data (pixel data) by vector length to create 3D texture"

However, this is only perpendicular extrusion (perpendicular vector), and frankly, it's slow.

Upvotes: 0

datenwolf
datenwolf

Reputation: 162297

Like said so often: OpenGL is "merely" a drawing API, rasterizing triangles to the screen. It doesn't deal with scenes. It doesn't deal with geometry.

Extrusion of a bitmap requires two specific tasks, neither of which OpenGL can do for you: Vectorizing the outline. Extruding the outline. The hard part is vectorizing, extrusion of a planar, closed path is simple.

Upvotes: 1

Related Questions