Knowing if a brush exists?

Blitz3D Forums/Blitz3D Programming/Knowing if a brush exists?

Ross C(Posted 2006) [#1]
Now, i know i have been posting alot of these topics :oP So, this should be the last one i reckon!

Now, when i create a blitz object, like a sphere or cube, do they have brushes automatically assigned to them? Because when i use getsurface() then getsurfacebrush(), it returns a number. Surely if the surface had no brush, it would return 0?

Graphics3D 800,600
SetBuffer BackBuffer()


cam = CreateCamera()
s = CreateSphere()

surf = GetSurface(s,1)

brush = GetSurfaceBrush(surf)


c = CreateCube()
surf1 = GetSurface(c,1)
brush1 = GetSurfaceBrush(surf1)


While Not KeyHit(1)



	UpdateWorld
	RenderWorld
	Text 0,0,"surface brush0 = "+brush
	Text 0,20,"surface brush1 = "+brush1
	Flip
Wend
End


If you don't have blitz3d, this returns two different numbers for the brushes. So, surely that suggests every blitz entity has a brush?

Futhermore, i need help on telling the difference between a surface brush and an entity brush. When it comes to saving, i don't really seem to know what brush to give as an entity brush and what brush to give as a surface brush...

Can anyone shed some light on this? Please? :o)


mr.keks(Posted 2006) [#2]
oehm, afair, getsurfacebrush always creates a new brush from the information of the surface. therefore it's completely logical that it always returns a number, 'cause a new brush is created. and of course a surface has always something like brush information stored in it.. that's the purpose of a surface xD. by default it's just the information: white, no texture, no special fx.


about the surface/entity thingie i'm not quite sure. maybe the entitybrush is attached first to every surface and then overwriten by the surface brushes?