PDA

View Full Version : Game Maker 3D Questions



edg3
20-08-2007, 07:22 AM
Started in 3D finally, after doing research on it for a while, and I didnt find any help on the following topics that I need help with, so Im bringing them to the community.

My current 3D work in Game Maker that Im using to test with: Game Maker 7 file (http://one.fsphost.com/edg3/3D.gmk)

2D overlays:
- Do I have to leave 3D mode to draw one, then open it again?
- Can I do normal 2D control for it, or do I need to work with the "z"-axis aswell?

Textures and lighting:
- I have two different coloured textures, but they both show as black, is there a special way to get a texture's index other than "background_get_texture()"?
("draw_set_color(c_white);" is needed to drawn so textures will be visible)
- When using lighting, it doesnt seem to make a difference, is it possibly because of the gray background? if not what could affect it?

Any help would be appreciated.

Tr00jg
20-08-2007, 05:40 PM
For the 2D you will have to draw an ortographic overlay... I did this for Roach Toaster 2. But this really screws working on the UI since the UI is actually just drawn on a certain z-height. The z-height is in fact the length of the room's width.

You will have to develop your own work-around to the above. It depends on how you view your 3-d world. Understand?

edg3
20-08-2007, 06:07 PM
Thanks tr00jg, I'll experiment with this. :)

Gazza_N
20-08-2007, 08:07 PM
Lighting: Game Maker uses Vertex lighting. This is a method that calculates a polygon's illumination based on the light's proximity to the polygon's vertices (among other factors). If, for instance, you create a giant plane for your "floor", a light will only work if it's placed near one of the corners (where the vertices that define the plane are). Sticking it in the middle of the plane where there are no vertices will result in zero illumination. If your level is small enough you can work around this by creating tile objects that draw a bunch of separately lit planes, but this can get really slow if your levels are large (learnt that while working on Deathbringer ^^; ).

edg3
20-08-2007, 08:34 PM
Thanks Gazza :) that really helped me alot.

Gazza_N
20-08-2007, 08:40 PM
Glad to hear that! :D

Of course, you could always just crank the light's strength up nice and high so that its outer limits reach the plane's vertices. That would also work. If you're just looking for global lighting then a directional light is the way to go (because it reaches all vertices equally), but if you want specific light spots, then the tile method is win. Depends on the effect you're going for.