Coding Questions for 3D Game programming

Advanced game related topics
User avatar
Übermann
New User
New User
Posts: 4
Joined: Mon Dec 07, 2009 11:44 am

Coding Questions for 3D Game programming

Post by Übermann »

Hi all.

1.- How do I define a Light Radius? Because i need the light radius to be independant from it's color intensity. This is, I need to create a large light source, with a low color value, for example, radius 50000 and color #110000 (or RGB(25, 0, 0)).

2.- How do Terrain Meshes works exactly? I want to create a terrain object, and i have created a 256 colours B&W TGA image to define heights, but when compiling the program, it returns a fatal error and crashes. Debugger returns no error or message. Any tip? I'm using GIMP last version to do this.

3.- How can i "print" a message to the player in the 3D Scene? I mean, what function i should use to do that? Is there any "PrintScene(<message>)" or similar?

That's all. Thanks in advance.
Tschüs.
Auf Deutsch, es klingt besser.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Coding Questions for 3D Game programming

Post by Comtois »

Übermann wrote:2.- How do Terrain Meshes works exactly? I want to create a terrain object, and i have created a 256 colours B&W TGA image to define heights, but when compiling the program, it returns a fatal error and crashes. Debugger returns no error or message. Any tip? I'm using GIMP last version to do this.
Extract from doc
The used picture must be a sqare, where x and y sizes are powers of 2 +1, with a minimum size of 65. Possible sizes can be 65x65, 129x129, 257x257 and so on. E.g. for a terrain with 64x64 grid of squares you need 65x65 pixels.
3.- How can i "print" a message to the player in the 3D Scene? I mean, what function i should use to do that? Is there any "PrintScene(<message>)" or similar?
You can use Window3D and Gadget3D to buid a GUI, or use a Sprite.
Please correct my english
http://purebasic.developpez.com/
User avatar
Übermann
New User
New User
Posts: 4
Joined: Mon Dec 07, 2009 11:44 am

Re: Coding Questions for 3D Game programming

Post by Übermann »

Comtois wrote:
Übermann wrote:2.- How do Terrain Meshes works exactly? I want to create a terrain object, and i have created a 256 colours B&W TGA image to define heights, but when compiling the program, it returns a fatal error and crashes. Debugger returns no error or message. Any tip? I'm using GIMP last version to do this.
Extract from doc
The used picture must be a sqare, where x and y sizes are powers of 2 +1, with a minimum size of 65. Possible sizes can be 65x65, 129x129, 257x257 and so on. E.g. for a terrain with 64x64 grid of squares you need 65x65 pixels.
I know that.
I just modified the image at the examples, drawing a simple white line, and saving the image as 256 colors (what the help file says) and black and white. But the program crashes. I didn't change the image size, so that's not the problem.
I did, with Gimp:
1.- Open the examples image,
2.- Draw a 5 pixels width white line,
3.- Save the image,
4.- Close Gimp, and compile/run the terrain sample again.
5.- When i choose the resolution and start the demo, the program crashes. No debug error or message.
Comtois wrote:
3.- How can i "print" a message to the player in the 3D Scene? I mean, what function i should use to do that? Is there any "PrintScene(<message>)" or similar?
You can use Window3D and Gadget3D to buid a GUI, or use a Sprite.
I have already solved that, aber i didnt test it. I think i can use the "DrawText( )" procedure.
Anyway, thanks for your help.

Auf Wiedersehen.
Auf Deutsch, es klingt besser.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Coding Questions for 3D Game programming

Post by Kaeru Gaman »

I think i can use the "DrawText( )" procedure.
as far I remember, Drawing doesn't work properly with DX9.
better use a Spritefont.
oh... and have a nice day.
Post Reply