Tuesday, December 2, 2008

Using A Programming Language to Model in 3D

In order to use a programming language, you need access to a compiler or interpreter. The simplest way I know of to get that is to sign up for web hosting, since most servers are running PSP.

To use a programming language to do something, you write an application.

A model begins as a list of points. At the end of the process, your application displays a rendering based on the points you supplied, and relationships you established between them.

A first component, then, would create a form into which you can enter your list of points and relationships. When you send your list, all your points get stored in variables. I guess your relationships do, to. I'm still thinking this out.

You could start a model by giving it a name:

(model name="my house")

next, you can name a few points:

(point name="left front corner of the foundation of my house" feet="0,0,0")
(point name="right front corner of the foundation of my house" feet="50,0,0")

Wow, I can see how this is going to take some doing. Boy, do I feel it will be worthwhile, though.

(point location="0,0,0" name="lower left corner of the outside of the front wall of the living room, where it meets the brick step at the base of the wall" accuracy="a guess")

If we don't include a location, our interface for recording observations can prompt us for it later.

Here, though, we've re-named the origin. Later, if we call that point, our interface can remind us that it has a history, and what the history is.

We could teach our application to understand the definition of a feature, for example, a wall.

(rectangular plane color="light grey") (name="outside face of front wall of living room")
(corner 1)(/corner 1)
(corner 2)(/corner 2)
(corner 3)(/corner 3)
(corner 4)(/corner 4)
(/rectangular plane)

More later.

No comments: