Quads

Blitz3D Forums/Blitz3D Beginners Area/Quads

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.

I actually use a tweaked version of yours JFK EO-11110...
Function CreateQuad()
	;Compliments of jfk EO-11110
	mesh=CreateMesh()
	surf=CreateSurface(mesh)
	
	;Texture Coords
	;(0,0) ... (1,0)
  	;  .         .
  	;  .         .
  	;  .         .
	;(0,1) ... (1,1)
	
	v0=AddVertex(surf, 0,40,0, 0,1)
	v1=AddVertex(surf, 31,40,0, 1,1)
	v2=AddVertex(surf, 0,40,31, 0,0)
	v3=AddVertex(surf, 31,40,31, 1,0)
	
	AddTriangle(surf,v0,v2,v1)
	AddTriangle(surf,v1,v2,v3)
	UpdateNormals mesh
 	Return mesh
End Function


then use below to finish the quad
Shdw = CreateQuad()
ShdwTex = LoadTexture("Shadow.png",2) ;Used flag 2 for alpha
EntityTexture Shdw,ShdwTex
ScaleEntity Shdw,.5,1,.5
PositionEntity Shdw,EntityX(Sphere,True)-8,EntityY(Sphere,True)-44,EntityZ(Sphere,True)-8
EntityParent Shdw,Sphere ;make the shadow follow the movable object


But Im having a major problem aligning this quad to the terrain. I tried my same exact code with a flattened sphere mesh and it worked great.