On Sat, Jan 25, 2003 at 02:58:39PM -0500, Michael Edwards wrote:
> Now, some questions:
> 1. I've made a Land and am moving the camera over it, adjusting for the
> height of the terrain by using:
> camera.add_vector(soya3d.Vector(camera, 0.0, 1.0 +
> island.get_height(int(camera.x),int(camera.z)) - camera.y, 0.0))
> 
> This works great (hovers 1.0 units over the Land) when I set the
> scale_factor of the land to 1.0, but not so well if I scale up or down. 
> Anyone know why this would happen?   Do I need to convert a coordinate
> system there?  I set the objects up like this:
> island = land.Land(0)
> ..
> world.set_shape(island)
> camera = soya3d.Camera(world)
> 
> It works fine if I divide the camera coords by the scaling factor (e.g.
> 1.5) like so:
> camera.add_vector(soya3d.Vector(camera, 0.0, 1.0 +
> island.get_height(int(camera.x /1.5),int(camera.z/1.5)) - camera.y,
> 0.0))

Use island.get_true_height(x, z), and use floats for them. This is
currently affected by the level of detail, so it is weird for stuff
that's far from the camera, but for setting the camera height it's
perfect. See the list archives for more discussion of this.

> 2. What's the Morph object?  Does it work like a Shape except that it
> can be modified?  Is it optimized like a Shape?  Is there a tut on
> this?  Or is it part of future features (animation?) as yet unrevealed?

I haven't used Morph yet :)

> 3. When you create a Land, is its shape optimized with a tree?  If not,
> could it be?  Would it be possible to get the mesh of the land before
> it's shapified and add in other meshes (buildings, walls, circus
> elephants) before shapification/treeing/whatever?

Land does use a tree structure for something from looking at the source,
but I don't know what you mean by "optimized with a tree." I expect the
interface to land to evolve quite a bit over the next few releases.

> 4. Since Soya uses SDL, is it possible to intercept the surface Soya
> uses to display and blit other things to it, SDL-style?  Or is all the
> blitting/buffering/whathaveyou inside the render() method or something?

There has been talk of allowing the use of pygame for handling some SDL
tasks, at which point it should be pretty easy to do your blitting.

> 5. How difficult would adding a Disc and/or Cylinder/Tube primitive be? 
> Is it just a matter of hacking it in Python or is there C work needing
> to be done?  Looking at the Sphere code, I think it's the latter.  Is
> there interest for this?  I could undertake it as a kind of journeyman
> project for me to learn more about Soya.  I think it's just a matter of
> setting a bunch of quads rotated arond an axis plus a Disc, which could
> be made with triangles like a bicycle wheel or from a point on the
> circumference, palm-branch style.

I think this these primitives should be done in C, because Soya aims to
be very high level, and round things can probably use NURBS and the
NURBS tessellation extensions to OpenGL, which would need to be done in
C.

> 6. (somewhat offtopic) I hacked out a Python version of the A* algorithm
> and slapped a frontend on using Soya.  The Soya frontend module
> specifically does pathfinding over a network of two-dimensional nodes
> (and has pretty fireworks on success), but the A* module itself is much
> more generalized (i.e. not just for map crawling).  Does anybody have a
> need for this?  Or is there an existing A* module for Python (I could
> use it as a benchmark)?  It also includes a PriorityQueue module, if
> that's a data type people are looking for.  It's all pretty rough, but
> works fine.

I've hacked up priority queues a few times. I'm not familiar with the A*
algorithm, but it sounds like it's some sort of way to do a search
through a graph? It sounds like these things could be in a separate
game-utils module, such as PyPlay. If you write stuff that should go
into Soya that depends on your modules *and* Soya, then it would make
more sense to include these in Soya.

Again, take a look at the list archives. You will find lots of
interesting discussion, and probably some ideas. I will hopefully have
CVS access soon so I can put my .obj/.mtl file reader in, as well as
working on separating the image loading from Soya itself and just
passing images as strings.

-- 
Sean Lynch http://sean.lynch.tv/

Attachment: msg00096/pgp00000.pgp
Description: PGP signature

Reply via email to