Shadow problems

Blitz3D Forums/Blitz3D Programming/Shadow problems

Yue(Posted 2010) [#1]


The problem I have is that while the car is static in the shade is correct, however when the car is moving shadow lengthens losing realism.

The light source, is the car with EntityX (Jeep1) etc. a main loop.

PositionEntity Fuente_Luz, EntityX(Jeep1,1)+.3, EntityY(Jeep1,1)+2, EntityZ(Jeep1,1)-.5


Any ideas.

Last edited 2010


jfk EO-11110(Posted 2010) [#2]
I'd need some more information about the problem. What kind of shadow is it.


Yue(Posted 2010) [#3]
Shadows are dynamic, Fastext.


Vorderman(Posted 2010) [#4]
Have you tried it with the lightsource static rather than moving with the car?


Yue(Posted 2010) [#5]
Problem solved.
Repeat 
	
	
	Repeat    
		
		elapsed = MilliSecs() - time   
		
		
	;===================
	; Solution Here
        ;===================
	Until elapsed
	
	
	ticks = elapsed / period
	tween# = Float(elapsed Mod period) / Float(period)
	For k=1 To ticks
		time = time + period
		If k = ticks Then CaptureWorld
		
		
	Next
	
	
	
	
	
	
	
	Camara_Libre()
	
	PointEntity FakeCamara,Jeep1
	
	
	If Calidad <> -1 UpdateShadows Camara,tween ; SOLUTION HERE
		
		
		
		pxRenderPhysic(60,0)		
		pxBodySetEntity(Jeep1,Px_Cuerpo_Jeep)
		pxWheelSetEntity(Llanta11, PxLlanta1, 1)
		pxWheelSetEntity(Llanta22, PxLlanta2, 1)
		pxWheelSetEntity(Llanta33, PxLlanta3, 1)
		pxWheelSetEntity(Llanta44, PxLlanta4, 1)
		
		
		pxWheelSetSteerAngle(PxLlanta1,Angulo_Llanta)
		pxWheelSetSteerAngle(PxLlanta2,Angulo_Llanta)
		
		
		
		CamaraFalsa()
		RenderWorld  tween  ; SOLUTION
	
		
		Camara_Libre()
		
		Flip Turbo
	
	
		Control_Auto()
			
	
	If KeyDown(1)
		Estado = True 
	ElseIf KeyDown(1) = False And Estado = True 
		Estado = False 
		Nivel = 0
		Eliminar_Nivel()
		FreeShadows()
		ClearWorld True,True,False
		pxDestroyWorld()
		
		Goto Menu_Inicial
		
	End If 
	
	
	pxWheelSetMotorTorque(PxLlanta3, Motor)
	pxWheelSetMotorTorque(PxLlanta4, Motor)
	pxWheelSetMotorTorque(PxLlanta1, Motor)
	pxWheelSetMotorTorque(PxLlanta2, Motor)
	
	
	
	If MouseDown(3)
		RotateEntity Centro_Auto,0,180,0
		
		
	End If 
	
	
  ;TurnEntity  Centro_Auto,0,1,0
		;If Y < 0 MoveEntity FakeCamara,-.5,0,0
		If KeyDown(208) pxBodyAddForce(Px_Cuerpo_Jeep,0,80,0,1)
			
	
Forever