Plotting Planes

Blitz3D Forums/Blitz3D Programming/Plotting Planes

Hello, is there a way to plot a plane (in the z-buffer) without actually plotting any colours on screen?

(I have found CameraClsMode where you can avoid a cls; but I'd rather have a cls and have planes just affect the z-buffer)

Thanks
Marg

Yes. Well sort of... :)
Graphics3D 800,600,0,2

cam=CreateCamera()

light=CreateLight()

cube=CreateCube()
EntityColor cube,255,0,0
sp=CreateSphere(8,cube)
EntityColor cube,0,255,0

PositionEntity sp,2,0,0

PositionEntity light,0,-2,-3

PositionEntity cam,2,2,-8
PointEntity cam,cube
PointEntity light,cube


zghost=CreateCube()

FitMesh zghost,-5,-5,0,10,10,10


While Not KeyHit(1)

	TurnEntity cube,.1,.2,.3
	UpdateWorld()
	
	CameraClsMode cam,True,True
	HideEntity cube
	ShowEntity zghost
	
	RenderWorld()

	CameraClsMode cam,True,False
	ShowEntity cube
	HideEntity zghost
	
	RenderWorld()

	Flip
	
Wend

End


Hello,

That's confused me :-)

I think I'll just plot the planes as normal.

Thanks
Marg

Why did you ask for it then?

Sorry, I'm new to 3D and found it hard to follow your code.

Maybe you could explain the theory a bit.

Marg

It's the use of FitMesh I don't understand. Do you create a cube which encloses the red & green cube & sphere?

And this zghost cube clips the red & green cube & sphere?

Marg

I meant white shpere & green cube.

Try commenting out the last 4 lines in the main loop above flip. You will see the box that acts as a zclipper.

Thanks Peter, I think I understand it now.
Marg