fun with caves

Miscellaneous Forums/Blitz Showcase/fun with caves

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.

http://graphics.cs.uiuc.edu/~jch/papers/pst.pdf

About the face mapping: It sucks if you have only one texture. But if you have a texture that have for example 8x8 texture tiles in it, and vary between using each of these on individual faces you can get really nice results. Each tile would use the same base and have variations on the theme.

I think that's a better solution, than doing 'Solid Mapping' as that requires a humongous texture if you want detailed texturing.

I can think of another way too, but I don't know if it will work.

If you map the scene directly from the XY plane, with planar mapping, but push the UV's depending on the Z depth at a spot.

Something like this:
Graphics3D 640,480,0,2
SetBuffer BackBuffer()

tex = LoadTexture("texture3.jpg")

mesh = CreateCylinder(16)
EntityTexture mesh,tex

xyscale# = 1.0
zscale#  = 0.5

n_surfs = CountSurfaces(mesh)
For s = 1 To n_surfs
	surf = GetSurface(mesh,s)
	n_verts = CountVertices(surf)-1
	For v = 0 To n_verts
		uu# = (VertexX(surf,v))*xyscale#
		uv# = (VertexY(surf,v))*xyscale#
		uu# = uu - (VertexZ(surf,v)*zscale)
		uv# = uv - (VertexZ(surf,v)*zscale)
		VertexTexCoords surf,v,uu,uv
	Next
Next

camera = CreateCamera()
PositionEntity camera,0,0,-3

Repeat
	TurnEntity mesh,1,1,1
	RenderWorld
	Flip
Until KeyHit(1)
Edit: It actually works pretty well :)