Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
krystal.lynn
Mar 8, 2007

Good n' Goomy
MSPaint drawings/explanations to follow. I'm a graphics neophyte, but we haven't been able to hire anyone better in our area, so I get to do some self learning.

I'm working on the graphics end of a sea ice physics simulation, where the collision area of each individual sheet of ice is represented in our physics engine as a 2D convex polygon of 4-8 sides or so. Rendering the simple polygons is easy, of course, but I now I need to take steps to get them look more realistic than blocky pieces of styrofoam. To that end, I'm hoping to apply some noise patterns to the boundary and surface of each polygon to roughen their appearance. I am just concerned about manipulating the geometry for now, later on I'll figure out textures and lighting and all that jazz. But first, I'm going to need a more detailed mesh than just the convex hull to accomplish anything (see crappy MSPaint): http://i.imgur.com/f0ciHBH.png

The question is, how do I go about generating this mesh using just the convex hull, and perhaps some parameterization to determine the 'resolution' of the internal vertices and the roughness of the outer edges (maybe I could parameterize based on the number of 'fragments' to break each edge into or something like that)?

This problem also has a B part, that I don't necessarily need completely figured out right away, but which might impose constraints on a solution to my first problem. Our physics model also simulates dynamic splitting of ice sheets, albeit in perfectly straight lines and only from vertex to vertex on the collision polygon (though arbitrary edge to edge splits may be supported in the future). These splits too would need some degree of roughness (again, MSPaint):
http://i.imgur.com/yvc9LNj.png

I was thinking maybe that tracing internal vertices closest to the axis of the split would be a good place to start, but I'm not married to the idea if it would be too expensive vs. just picking random points offset from the axis and retessellating the fragments.

Am I barking up the right tree? Any insight would be appreciated. We're using C++ and OpenSceneGraph but I'm happy (happier?) to do straight OpenGL if need be.

Adbot
ADBOT LOVES YOU

krystal.lynn
Mar 8, 2007

Good n' Goomy

High Protein posted:

That's an interesting problem. Looking at your example picture, it seems that what you've effectively done is taking a point about halfway along an edge, and moved that along the edge normal a random amount (positive or negative). So you could keep doing that iteratively. However you'll have to make sure you don't end up with intersecting edges.
For the cracks you could do the same thing. The amount of iterations you use would decide how ragged the crack ends up being.

Here I was hoping it would be a boring problem :)

I've implemented a 'roughing' algorithm like I've described for the edges in similar situations a few times before, so I'm not extremely worried about that, but I've never had to generate a triangulation for a concave shape with a bunch of vertices inside it. Can I just feed a list of vertices to a tessellation library, like a Delaunay triangulator or something, and get the results I'm looking for, or would I have to take additional care since I'm working with concave shapes?

This is what I'd like to do:


This is what I'd like to avoid:


Also, if anyone knows a good C++ triangulation library that can do what I want (or can speak to the quality of OpenSceneGraph's), I'd appreciate it. Sorry if some of these questions could be answered by my own experimentation, but I'm away from the office for a few days and would like to be able to turn over a few ideas in my head over the weekend and hit the ground running when I return to work.

krystal.lynn
Mar 8, 2007

Good n' Goomy

Back on this after a few days, but I've looked into GLUTess and it seems like I'm only able to specify the contour of the polygon. What I require is a near-uniform tessellation like the example I gave in my last post, since I need to be able to apply heightmaps. Possible with GLUTess or do I need something else?

krystal.lynn
Mar 8, 2007

Good n' Goomy
My powers of computational geometry may be kinda weak but I think the eminently un-Googleable Triangle is getting me results that are good enough for government work, at least. The license terms are somewhat vague but I am doing academic research so I should be OK.



If I decide the triangulation must be more strictly uniform, it seems like I'd be easily to specify a set of 'constraining' vertices on the inside of the boundary to make the triangulation more rigid. It's an old fashioned library (IMO a good thing) and I haven't profiled it for speed yet, but it got me some pretty pleasing results on the first try!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply