Subject: RE: [Nel] Landscapes without 3DSMax

From: "Paul Siegel" <[email-masked]>
Date: Tue, 18 Dec 2001 09:49:45 -0500

My apologies, I accidentally sent this first to nel-admin.  Guess the
reply-to of the digest isn't set up to go to the correct place.  Here it is
again, I hope nobody gets this twice:

Thank you everyone for the links.    I'm afraid though that these terrain
building packages generate height fields, and as you may or may not be
aware, NeL uses bezier patches, not height fields to generate its terrain.
Therefore, I've finally settled on the most basic thing I could find, namely
sPatch.  (http://www.geocities.com/getspatch/index.html).  It is little more
than a bezier patch editor, but currently that's all I need.  There appears
to be a more feature rich package based on sPatch called hamaPatch
(http://www.geocities.com/Tokyo/Ginza/6625/soft10.html), but currently all
documentation on this is in Japanese and I don't speak the language.
Perhaps my work can some day be moved to hamaPatch, but for the moment I'm
sticking with sPatch.  Which means we should be able to generate the zone
files with sPatch, but will need a seperate piece of software to paint the
textures (since sPatch doesn't support any kind of texturing).  But I'll
burn that bridge when I get to it.  ;)

Fortunately, sPatch has good documentation on creating export plugins, and
I'm well on my way to successfully making one.  I have a couple questions
though for anyone on this list whi is familiar with the 3D code.

1.  How much information of the CPatchInfo object must be filled in to have
a viable object?  sPatch gives me a 4x4 array of vertexes which I can use to
populate the vertices, tangents, and interiors of the CPatchInfo object.
However, I am still a bit unclear what much of the data in the CPatchInfo
object is, especially the BindEdges (4 CBindInfo structs).  Are these filled
in when welding the zones together, or are they something I will need to
fill in upon generating a single zone?

2.  Once I manage to export a .zone file, what's the quickest, dirtiest way
to test it?  Will I need to build an entire app just to load the .zone, or
is there some way I can easily hack it into the Snowballs client just to see
if it indeed exported a valid file?

Thanks again everyone for all the help.  This is a great project, and I'm
having lots of fun playing with it.

Paul

> And more:
> http://terraform.sourceforge.net/
> http://ftp.arl.army.mil/brlcad/
> http://www.planetside.co.uk/terragen/
>
> Saturday, December 15, 2001, 1:02:07 PM, you wrote:
>
> ME> Tony Hoyt schrieb:
>
> >> Paul Siegel wrote:
> >> >
> >> > Hi everyone -
> >> >
> >> > I'm wondering if there's a way to build landscapes without 3D Studio
> Max.
> >> > That's some pricey software just to do level editing.  Is anything
> >> > available, or being worked on?  Or am I going to have to learn how to
> >> > rewrite the max plugins for Blender?
> >>
> >>   Blender is my choice as well for a good free alternative 3d editor.
> >> I'm not sure how you make plug-in's for Blender other then with python
> >> but if you can do it, I wish you all the best of luck. I think the
> >> problem with doing a port is that if your not able to see the original
> >> in action or see what library calls it's makeing, etc.  It's going to
be
> >> rough going.  But if your serious about it, I'm willing to give a hand
> >> although I don't have 3D Studio Max as well.
>
> ME> There's also a free landscape modeller at
> ->> www.geofrac2000.com
>
> ME> It was once commercial and its interface is very much like that of
> 3dsmax.
> ME> The author discontinued the project and made it available for free,
but
> it's
> ME> still worth a look. You can use standard algorithms (perlin, etc.) for
> ME> landscape generation, create mountains and craters or just paint with
> the
> ME> raise/lower-tool. Realtime 3D-display just like 3dsmax as well.
>
> >>
> >>
> >>   Tony
> >>
>
> ME> -Markus-
>
>
> ME> _______________________________________________
> ME> Nel mailing list
> ME> [email-masked]
> ME> /mailman/listinfo.cgi/nel
>
>
>
> --
> Dim Segebart                         mailto:[email-masked]

---

From: "Cyril 'Hulud' Corvazier" <[email-masked]>
Date: Tue, 18 Dec 2001 20:20:34 +0100

Hi Paul,

> aware, NeL uses bezier patches, not height fields to generate its terrain.

You can build patches with an heightfield. It a fast way to generate
a simple lansdcape. Simply raise the tangeants vertices with the joined
vertices of a bezier patch : you have a heightfield !

> fill in upon generating a single zone?

The BindEdges info are required to properly link patches together at
runtime. You have to filled them for internal zone linking. zone_welder will
fill them
of inter-zone link. Hear come some explications on how to fill the
CBindInfo.

The patches can be linked those way : (warning ASCII arts in non-constant
size
fonts.. :-)  )

---

The edge numbers are :

     3
   ***
0 *  * 2
   ***
     1

---

There is 3 ways to bind patches together. (1-1, 1-2, 1-4)

---

One patch on another :

**********
*      *        *
*  0  *   1   *
*      *        *
*      *        *
**********
CBindInfo:
Patch 0, edge 2 : NPatchs = 1,  MultipleBindNum = 1, Next = { Patch 1 },
Edge = { 0 }
Patch 1, edge 0 : NPatchs = 1,  MultipleBindNum = 1, Next = { Patch 0 },
Edge = { 2 }

---

Two patches on another (Bind 2)

**********
*      *   1   *
*  0  ******
*      *   2   *
**********
Bind info:
Patch 0, edge 2 : NPatchs = 2,  MultipleBindNum = 1, Next = { Patch 1, Patch
2 }, Edge = { 0, 0 }
Patch 1, edge 0 : NPatchs = 1,  MultipleBindNum = 2, MultipleBindId = 1,
Next = { Patch 0 }, Edge = { 2 }
Patch 2, edge 0 : NPatchs = 1,  MultipleBindNum = 2, MultipleBindId = 0,
Next = { Patch 0 }, Edge = { 2 }

---

4 patches on another (Bind 4)

**********
*      *   1   *
*      ******
*      *   2   *
*  0  ******
*      *   3   *
*      ******
*      *   4   *
**********
Patch 0, edge 2 : NPatchs = 4,  MultipleBindNum = 1, Next = { Patch 1, Patch
2, Patch 3, Patch 4 }, Edge = { 0, 0, 0, 0 }
Patch 1, edge 0 : NPatchs = 1,  MultipleBindNum = 4, MultipleBindId = 3,
Next = { Patch 0 }, Edge = { 2 }
Patch 2, edge 0 : NPatchs = 1,  MultipleBindNum = 4, MultipleBindId = 2,
Next = { Patch 0 }, Edge = { 2 }
Patch 3, edge 0 : NPatchs = 1,  MultipleBindNum = 4, MultipleBindId = 1,
Next = { Patch 0 }, Edge = { 2 }
Patch 4, edge 0 : NPatchs = 1,  MultipleBindNum = 4, MultipleBindId = 0,
Next = { Patch 0 }, Edge = { 2 }

---

Note that zone_welder welds automaticaly the zones together but don't
generate bind info for internal patch linking in a zone.
It searches for shared vertices in the 2 zones and weld them. Zone_welder
can perform only 1-1 bind type.

I hope this is understandable, don't hesitate to ask for details.

> if it indeed exported a valid file?

You can replace a zone in snowball, or make a simple application to see
the zone. If you want, i can post a peace of code for a small app.

Cyril Corvazier

---

From: "Cyril 'Hulud' Corvazier" <[email-masked]>
Date: Wed, 19 Dec 2001 09:32:19 +0100

There is mistakes in the previous mail,

---

> Patch 0, edge 2 : NPatchs = 2,  MultipleBindNum = 1, Next = { Patch 1,
Patch

Please read :

Patch 0, edge 2 : NPatchs = 2,  MultipleBindNum = 1, Next = { Patch 2, Patch
1 }, Edge = { 0, 0 }

---

> 2, Patch 3, Patch 4 }, Edge = { 0, 0, 0, 0 }

Please read :

Patch 0, edge 2 : NPatchs = 4,  MultipleBindNum = 1, Next = { Patch 4, Patch
3, Patch 2, Patch 1 }, Edge = { 0, 0, 0, 0 }

Cyril Corvazier

---

From: "Cyril 'Hulud' Corvazier" <[email-masked]>
Date: Wed, 19 Dec 2001 18:21:17 +0100

Hi Paul,

Forget all the ASCII parts of the 2 previous mail, here is the good way to
fill the CPatchInfo::CBindInfo structure :

---

We will assume all patches in this example are oriented like this

0      3
  ***
  *  *
  ***
1      2

---

The edge numbers are :

      3
    ***
 0 *  * 2
    ***
      1

 ---

 ---

 One patch on another :

 **********
 *      *        *
 *  0  *   1   *
 *      *        *
 **********
 CBindInfo:
 Patch 0, edge 2 : NPatchs = 1, Next = { Patch 1 }, Edge = { 0 }
 Patch 1, edge 0 : NPatchs = 1, Next = { Patch 0 }, Edge = { 2 }

 ---

 **********
 *      *   2   *
 *  0  ******
 *      *   1   *
 **********
 Bind info:
 Patch 0, edge 2 : NPatchs = 2,  Next = { Patch 1, Patch 2 }, Edge = { 0,
0 }
 Patch 1, edge 0 : NPatchs = 1,  Next = { Patch 0 }, Edge = { 2 }
 Patch 2, edge 0 : NPatchs = 1,  Next = { Patch 0 }, Edge = { 2 }

 ---

 **********
 *      *   4   *
 *      ******
 *      *   3   *
 *  0  ******
 *      *   2   *
 *      ******
 *      *   1   *
 **********
 Patch 0, edge 2 : NPatchs = 4,  Next = { Patch 1, Patch 2, Patch 3, Patch
4 }, Edge = { 0, 0, 0, 0 }
 Patch 1, edge 0 : NPatchs = 1,  Next = { Patch 0 }, Edge = { 2 }
 Patch 2, edge 0 : NPatchs = 1,  Next = { Patch 0 }, Edge = { 2 }
 Patch 3, edge 0 : NPatchs = 1,  Next = { Patch 0 }, Edge = { 2 }
 Patch 4, edge 0 : NPatchs = 1,  Next = { Patch 0 }, Edge = { 2 }

 ---

Sorry but i have been confused by the two classes called CPatch::CBindInfo
and CPatchInfo::CBindInfo. :-)

Cyril Corvazier.