HAVE A LOOK AT THIS 3D EFFECT !!!

Miscellaneous Forums/Blitz Showcase/HAVE A LOOK AT THIS 3D EFFECT !!!

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.

[In the picture I posted you can clearly see that all faces of the, granted, simple mesh near the light object are in fact illuminated, and those no where near it are not. I think it is a better way to achieve a torch effect than just using a DirectX light.]Yeah only the mesh near the light object is illuminated, because that's the only mesh which has the normal map applied to it. If you applied the normal map over all the geometry (like you should if you were lighting a map with a torch), the map will be illuminated in the same way as with a standard light.

But there are other really cool effect that you can achieve with this technique. You can illuminate objects giving the same effect than in Zelda: Wind Waker.

Check this source to see what I mean (it requires media from the zip file Eurythmia posted):

;Graphics3D 640,480,16,1
Graphics3D 1024,768,16,2

AmbientLight 20,20,20

;ClearTextureFilters

cam=CreateCamera()
	CameraRange cam,.01,100
	PositionEntity cam,2,4,1


l=CreateLight(2)
	LightRange l,20 ;<- try modifying this
	RotateEntity l,0,0,0
	LightColor l,255,255,255
	PositionEntity l,2,2,1

s=CreateSphere(8,l)
	ScaleEntity s,.2,.2,.2
	EntityFX s,1:EntityColor s,0,255,255
	EntityAlpha s,.5

tex=LoadTexture(".\cero.png",1+4+512) : TextureBlend tex,4
tex2=LoadTexture(".\metal.jpg",1+512)
tex3=CreateTexture(64, 64, 1+512)
SetBuffer TextureBuffer(tex3)
ClsColor 255, 255, 0 : Cls
SetBuffer BackBuffer()

m=LoadMesh("room.3DS")
	ScaleEntity m,1.5,1.5,1.5
	PositionEntity m,0,-1.25,0
	EntityTexture m,tex2,0,1

m2=LoadMesh("room.3DS")
	ScaleEntity m2,1.5,1.5,1.5
	PositionEntity m2,0,-1.25,0
	EntityTexture m2,tex,0,0
	EntityTexture m2,tex3,0,1
	EntityBlend m2, 3


ScaleTexture tex,.4,.2
ScaleTexture tex2,.4,.2

angle#=0

While Not KeyDown(1)


	PositionEntity l,7.5*Sin(angle),2.5+1.75*Sin(angle),7.5*Cos(angle)
	
	;MOVE CAMERA
	If KeyDown(205)	MoveEntity cam,.1,0,0
	If KeyDown(203)	MoveEntity cam,-.1,0,0
	If KeyDown(200) MoveEntity cam,0,0,.1
	If KeyDown(208) MoveEntity cam,0,0,-.1
	TurnEntity cam,MouseYSpeed()/20,-MouseXSpeed()/20,0
	RotateEntity cam,EntityPitch(cam),EntityYaw(cam),0
	MoveMouse 320,240
	;--------------------


	If KeyDown(30) TurnEntity m,0,1,0 : TurnEntity m2,0,1,0
	If KeyDown(31) TurnEntity m,0,-1,0 : TurnEntity m2,0,-1,0


	
	angle=angle+1
	If angle>=360 angle=0
	
	UpdateWorld
	RenderWorld
	
	If KeyHit(17) Then w=Not w WireFrame w
	
	Text 10,10,"ARROWS and MOUSE to move"
	Text 10,30,"use A and B to rotate the model"
	Text 10,50,"W to wireframe"
	Text 10,70,"modify the LightRange in the code to increase/decrease the distance"
	Flip
Wend

MoveMouse 400,300:End