Posts Tagged ‘3d’
Filed under: Game Maker

I wrote this ages ago and it didn’t receive much publicity but unless things changed, it’s the most powerful tool you have to get high end models into GM. Not feature-rich, but powerful. This will overcome vertex count limitations. And this will work on models which have more than one surface , and it will automatically convert textures to .bmp (although since gm7 this might not even be needed anymore). It loads 3ds, x, and b3d formats.
Oh also, now that gm has a function to save and load models, you can overcome the long load times by having a gm script import an .i3d mesh and save it as a gm mesh, and from then on only load that one.
One bug I noticed is that due to the way it handles loading, you can’t keep it too ‘deep’ on your harddrive. The path where the model sits must be short. Like c:\temp\rah\model.ble worked for me and c:\gdev\gm\stuff\temp\model.ble failed.
Model Loader
Tags: 3d, development, tools
Permalink Comments (6) GearGOD Oct 2, 2007
Filed under: Game Maker

A little trick I did to show that some limitations of d3d can be cheated around. Here we have a reflective surface. This is achieved by resolving a model’s vertices into screenspace (once again game maker limits and provides no transform functions so I had to pretty much duplicate d3d output with scripts). It is however, very limited and only shows the idea. To make it work in a game with a camera, you’ll need to do a bit more in the way of transforms.
Oh yeah. The i3d format it uses is produced by my mesh exporter also available here.
Reflections
Tags: 3d, effects, snippets
Permalink Comments (0) GearGOD Oct 2, 2007
Filed under: Game Maker

I whipped this up after someone posted on the GMC asking about it. Mark’s naiive approach to drawing in version 6 and above resulted in it having a d3d and normal mode when both are esentially the same thing. Enabling d3d makes a number of things impossible. Mainly, surfaces. Not having d3d makes other things impossible like zbuffer and perspective correct texturing.
If you ever try to draw a skewed or distorted polygon with textures, you’ll see that there’s a weird artifact. Unfortunely only Mark can fix this, but we can approximate a solution by subdividing our polygon into several segments and interpolating the texture coordinates for them. By providing properly calculated UVs to each segment, we reduce the error the renderer produces by giving it more clues as to what the UV values should actually be.
Perspective Correct Texturing
Tags: 3d, tutorials
Permalink Comments (4) GearGOD Oct 2, 2007