Here’s a simple export template for Structure Synth that produces easy-to-parse output. Save the file linked below in Structure Synth’s misc directory. Note that there is a limitation in the 0.8.5 version of Structure Synth (a small buglet, actually) that prevents RGB data for line primitives from being available to a render template.
- lines starting with ‘#’ are comments
- tokens are simple ascii strings separated by whitespace
- primitives are output one per line, and start with one of: “box”, “sphere”, “grid”, “line”, or “dot”, followed by an object name
- box primitives specify a floating-point RGBA value, followed by the elements of a 4×4 transformation matrix
- grid primitives have the same format as box primitives
- sphere primitives specify an RGBA color value, the 3D coordinates of the sphere, and the radius of the sphere
- line primitives specify an alpha value (no color available info available at this time), and the starting and ending 3D coordinates of the line (from, to)
- dot primitives specify an RGBA color value, and the 3D coordinates of the dot
In the spirit of obj2egg for Panda3d, here’s my early but mostly working version of 3ds2egg.py. It will handle simple untextured materials (diffuse material color settings are used) and simple textured objects. It will also handle single- and double-sided .3ds material settings applied to a mesh.
Among the things it doesn’t handle: smoothing groups, node tags, and keyframer stuff. I’m fairly certain that I got a few things wrong with respect to parameter matching .3ds and .egg material settings. Basically, if it’s something that I didn’t need, I didn’t implement it yet. You’ve been warned.
Licensed under the WTFPL.
I’ve been evaluating Panda3D, and I wanted to see if I could find a low-hassle way of getting Wavefront .obj format models into Panda’s .egg format. I found obj2egg could hatch a suitable .egg, but it couldn’t handle materials and textures.
Here’s my improved version: obj2egg.py. It handles basic diffuse texture maps. My particular need was for coloring untextured models, and it can do that too. There is some room for interpretation as to how one should interpret color information in a .obj and a .mtl, so it may not do what someone else wants. Oh yeah, it supports Wavefront’s polyline primitives if you’re into that sort of thing.
Caveats, bugs, limitations, etc: it isn’t the most efficient Python code I’ve put together, it probably won’t handle every .obj you might throw at it, it won’t handle embedded material definitions (they must be in a .mtl file), and probably does a bazillion other things wrong.
Licensed under the WTFPL.
One .dif with 2048 brushes (each brush is a cube). Generated procedurally, exported as a .map, imported into Torque Constructor, exported as a .dif. Pitch and roll control input from the mouse has been disabled; horizontal motion of the mouse is mapped to yaw force input. See also chaotic attractor test #1.
Motion test of a 3rd-person camera mode implemented in my ever-evolving SpriteBase class. The wingman on the right is dynamically attached to the object controlled by the player. The maze in the background is a standard terrain object made by importing a bitmap and slapping on some odd textures I made with Bryce.
Now that I can move and shoot, I guess it’s time to make something to shoot at.
To do: teach Projectiles and Particle Emitters about dynamic object attachment.