- Title: TheSnidr's Mode7
- Description: A 3D system not using GM's d3d. Also fakes the SNES' background scaling mode 7!
- GM Version: GM 8
- Registered: Yes
- File Type: .rar
- File Size: 816kb
- File Link:
http://host-a.net/u/playway/Mode7.zip - Please comment if you download

Additional Info
Hi, and thanks for showing interest in my fake 3d first person/ mode 7 engine!
This engine provides an oldschool effect called Mode 7, a background scaling technique that gives an illusion of 3D space, without entering game maker's 3D mode at all! Take Mario Kart for the SNES as an example.
Please give credit when used!

It also comes with functions for drawing different primitives and sprites.
This is based on the "Wannabe 3D" engine, which was made for use with topdown and platform games.
How to use
Before calling any of the other scrips, you must call fps_set_projection. This script creates all the variables needed to make the engine work.
fps_set_projection(camera_x,camera_y,camera_z,camera_angle,camera_tilt,camera_offset,view_scale,max_dist,min_dist)
- camera_x/y/z: The position of the viewer in the room
- camera_angle: The direction you're looking, in degrees
- camera_tilt: Tilt the camera slightly up and down. Note, you cannot look directly up or down. For default setting, write 0
- camera_offset: Set to a negative value to place camera behind player, and positive to place it in front. For default setting, write 0
- view_scale: The scale of the world around you. A scale of 1 makes things appear the same size they are in the room editor. I usually use a scale of 10 or greater.
- max_dist: The maximum drawing distance in pixels. Things further away than this won't be drawn
- min_dist: This argument is rather abstract, but it basically moves the minimum drawing distance. It's a relative scale, and doesn't have a meaningful measure. Positive numbers move it in front of the camera, negative move it behind the camera. For default setting, write 0
Now that you've set the projection, you can start adding content. The fps_draw_sprite script has pretty much the same arguments as the function draw_sprite, except it adds 3 arguments:
fps_draw_sprite(sprite_index,image_index,x,y,z,xscale,yscale)
- Sprite_index/image_index: The image of the sprite that is to be drawn
- x/y/z: The position of the origin of the sprite
- xscale/yscale: The scale of the sprite. Use 1 for default
Here's how to draw a wall
fps_draw_wall(texture,x1,y1,z1,x2,y2,z2)
- texture: Supply a texture index. Find the texture index of a sprite by using sprite_get_texture(sprite_index,image_index)
- x1,y1,z1/x2,y2,z2: Similar to the function draw_rectangle, only in 3 dimensions: Draws a textured rectangle with lower left corner at (x1,y1,z1) and upper right corner at (x2,y2,z2).
The engine also comes with a script for drawing with background scaling mode 7, a scaling method that's been popular since 3D games on SNES (mario kart, f-zero).
Here's how to use it:
fps_draw_mode7(texture_index,quality,repeat,z,width,height)
- texture: Supply a texture index. Find the texture index of a sprite by using sprite_get_texture(sprite_index,image_index)
- quality: A relative scale, where higher means better, but slower. I usually use a quality of 3 or 4.
- repeat: Whether or not to repeat the texture, drawing them tiled.
- z: The z-value, hopefully this needs no explanation
- width/height: The width and height of the texture in the room, as seen from above. To make it fill the whole room, write "room_width,room_height"
Games made with this engine
Doom
Airfighter
Mario Kart
Affine texture mapping
As some of you know, game maker uses affine texture mapping. For those who didn't know, here's the difference between affine and correct mapping: http://upload.wikime...ure_mapping.jpg
This is the reason for "waves" or morphing appears on the ground or on fake 3d walls. As you can see on the picture of the mario kart track, the area close to the camera is a little wavy. That's the doing of the affine texture mapping.
More triangles will fix this problem though - but too many will slow your game down.
Your job will be to find the perfect scale between looks and speed.
Good luck!











