realbasic-games
[Top] [All Lists]

Re: Algorithm

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Algorithm
From: Joseph Nastasi <joe at pyramiddesign dot us>
Date: Tue, 4 Oct 2005 12:30:46 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <f7d19b47cccb7f1fb545e3315498cc53 at pyramiddesign dot us> <a06200702bf684225cc27 at [10 dot 0 dot 1 dot 4]>

On Oct 4, 2005, at 10:33 AM, Joseph J. Strout wrote:

At 7:36 AM -0400 10/4/05, Joseph Nastasi wrote:

If I build a trimesh of random size, is there an algorithm that will help me define the triangle points for Trimesh.Triangles.SetABC? I've been trying to find a method that is universal as I can never know what the size will be. Basically, I'm building a simple image to height map tool.

Yes, there are such algorithms -- the question is, how complex do you want it? A simple approach is to just divide your surface into a regular array, where if you look down on your terrain, all the vertices fall on a square grid. This is what I did in my old waving-flag demo in RB Developer (of course I did that via declares; nowadays you could do it all with the new Trimesh class). That's a good approach when the position of the vertices may be changing dynamically, so you really have no reason to use anything other than a regular grid.

This is what I wound up doing. I have not tested in real time yet.

To solve that problem, you could use something such as Delaunay triangulation. Here's a site that presents a quick overview and links to this and other algorithms for mesh generation: <http://www.ics.uci.edu/~eppstein/gina/meshgen.html>.

I'll check this out, but for my needs, the local landscape doesn't stick around long when you're accelerating at 3-6 G's....
:-)

Thanks, Joe!
--
Joseph Nastasi
Pyramid Design - a software development firm
http://www.pyramiddesign.us
Voice 609 601-0814      Fax 609 601-0815
Products:
A-OK! Spacecraft Simulation System - http://aok.pyramiddesign.us
A-OK! The Wings of Mercury
FTP Suite for REALbasic - http://ftpsuite.pyramiddesign.us
Proud Sponsors of REALbasic Olympics 2005




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>