How to tell what surface is below

Blitz3D Forums/Blitz3D Programming/How to tell what surface is below

WolRon(Posted 2004) [#1]
I am making a 3D racing game, and I would like to know how you guys tell what kind of surface/material is below the tires(tar, dirt, grass, mud, water, vaseline ;) ).

I can pretty much assume that you perform a LinePick downwards from each tire, but then what do you do with that information?


Jeremy Alessi(Posted 2004) [#2]
Get the texture of the mesh and use that (Blitz has built in get texture ability now). Or use names for the mesh below which are established in your editor.


jhocking(Posted 2004) [#3]
Do a LinePick down, then used PickedSurface. From this use GetSurfaceBrush and GetBrushTexture to determine the texture applied.


WolRon(Posted 2004) [#4]
Umm, I don't seem to have a GetSurfaceBrush command or a GetBrushTexture command.

Did you mean something else?

I have V1.87.

[Edit]Upon furthur inspection, it appears that the commands are listed in the help file, but do not 'highlight' in the editor...[/Edit]


semar(Posted 2004) [#5]
Umm, I don't seem to have a GetSurfaceBrush command or a GetBrushTexture command

http://www.blitzbasic.com/b3ddocs/command.php?name=GetBrushTexture&ref=3d_a-z

http://www.blitzbasic.com/b3ddocs/command.php?name=GetSurfaceBrush&ref=3d_a-z


Damien Sturdy(Posted 2004) [#6]
What editor are you using? some IDEs require you add new commands to a "keywords" file.

Visual Blitz has Keywords.INI i think....


WolRon(Posted 2004) [#7]
Actually, they do highlight in the standard IDE. They just aren't being recognized in VisualBlitz.


Damien Sturdy(Posted 2004) [#8]
yeah i know they will highlight in the standard IDE... but as i said, SOME require adding things to the keyword file. thats why i asked what IDE he was using :P


WolRon(Posted 2004) [#9]
Yeah, that was the problem. Thanks for the help Cygnus.


Skitchy(Posted 2004) [#10]
Here's my suggestion :
'Bake' your surface properties into your texture names.
eg. tarmac_14_87.png
could be a tarmac texture with a 'traction' of 14 and a 'max speed' of 87. Obviously the values and their uses are up to you.
Or have a lookup array that returns your surface physics properties when it encounters certain names like 'tarmacfast.png' or 'grasswet.png'.

I did a similar system to describe certain surface properties in LightBulb like alpha, fullbright etc. and it worked like a charm :)