Plotting Planes

Blitz3D Forums/Blitz3D Programming/Plotting Planes

JBR(Posted 2004) [#1]
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


Difference(Posted 2004) [#2]
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



JBR(Posted 2004) [#3]
Hello,

That's confused me :-)

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

Thanks
Marg


Difference(Posted 2004) [#4]
Why did you ask for it then?


JBR(Posted 2004) [#5]
Sorry, I'm new to 3D and found it hard to follow your code.

Maybe you could explain the theory a bit.

Marg


JBR(Posted 2004) [#6]
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


JBR(Posted 2004) [#7]
I meant white shpere & green cube.


Difference(Posted 2004) [#8]
Try commenting out the last 4 lines in the main loop above flip. You will see the box that acts as a zclipper.


JBR(Posted 2004) [#9]
Thanks Peter, I think I understand it now.
Marg