Normals (THEY HURT)

Blitz3D Forums/Blitz3D Programming/Normals (THEY HURT)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Why does the collision normals command report an impossible figure in this code? With the cube that the sphere collides with at its default rotation the collisions normals correctly reports x1, y0, z0. When the cube is rotated to a 45 degree angle, to my reckoning it should report x0.5, y-0.5, z0. Instead I get a physically impossible figure of x0.7, y-0.7, z0.

Any ideas?

Here’s the code


Graphics3D 800,600

SetBuffer BackBuffer()

Const WALLS=1
Const BALLS=2


camera=CreateCamera()
CameraRange camera,0.1,1000 
CameraZoom camera,1.4


light=CreateLight(1)
PositionEntity light,0,0,-500
AmbientLight 100,100,100


ball1=CreateSphere(8)
PositionEntity ball1,0,0,15
EntityType ball1,BALLS


wall=CreateCube()
PositionEntity wall,-3,0.5,15
RotateEntity wall,0,0,45;EDIT ME OUT
EntityType wall,WALLS



Collisions BALLS,WALLS,2,2


While Not KeyDown( 1 )
	UpdateWorld
	RenderWorld

	MoveEntity ball1,-0.01,0,0
	
	If CountCollisions ( Ball1 ) >0 Then 
		Text 0,0,"x "+CollisionNX#( wall,1 )
		Text 0,10,"y "+CollisionNY#( wall,1 )
		Text 0,20,"z "+CollisionNZ#( wall,1 )
	EndIf
	Flip
Wend