Sign in to follow this  
soivex

Shape rendering problem.

Recommended Posts

Hello. Guys, i need some help here. So, i have a random shape (can be convex or non convex form). Actually this shape is a connected spline. I'm talking about 2D shapes. So, i need to conver it to the 3D space (it's simple, just adding z coordinate) and put some texture on it. The main problem for me - how to render it using just one call to DrawPrimitives. In general i need to split my shape (even in 2D) into number of small triangles. I have'nt see any problems for convex shape. But i DON'T know how to deal with non convex shapes. May be there is some common way to solve this issue for convex and non convex shapes? Please, help. Thanks!

Share this post


Link to post
Share on other sites
I'm a little slow understanding, so let me reformulate. You have a spline (a contour) defined by some points, it's 2D, and you want to fill it. Right ? Since your spline is 2D, you don't need to add points inside the shape : you can fill it with polygons (triangles) going through the contour nodes. This process is called tessellation or polygon triangulation, and there are glu-commands to deal with it. You can also split your shapes into triangles yourself, there are plenty of algorithms available. Example :

http://www.gamedev.net/reference/articles/article408.asp

I use another algorithm that detects the sharpest convex angle of the contour and puts a triangle there, then goes on to the next sharpest angle of the remaining shape, and so on. Things are only getting a little more complicated when your shape has holes in it.

Share this post


Link to post
Share on other sites
Thanks for reply!

Just imagine that my shape is a jigsaw puzzle piece.
And just need to render it avoiding any masks creation etc..
Just a number of points converted to a number of triangles (here comes my troubles with non-convex shapes) and so on...
I don't actually know how to create this triangles!

Thanks!

Share this post


Link to post
Share on other sites
As I said, look for "polygon triangulation" on the net, and you'll find plenty of stuff. Most of the algorithms deal with non-convex polygons.

Share this post


Link to post
Share on other sites
I have a question regarding 3d modelling software in general. I work in a work working facility, we do a lot of custom work. I want to do up some basic drawings and make it easy enough for people in sales to change lengths. ideally would be for them to click on the length and enter a new number in. i know in solid edge this will work, are there any other 3d modelling software where this can be done easily? and what does it cost for a license?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this