Portals, simplified

Blitz3D Forums/Blitz3D Programming/Portals, simplified

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.

Areas that are two degrees away are hidden.

halo,

Please elaborate. I assume each box stores a list of potentially visible polygons (meshes|areas|etc)? If so, will this not require preprocessing? If this data is preprocessed, why would it require areas that are two degrees away be hidden?

I've dubbed the technique above Cubic Space Partitions (CSP). With CSP each box (cube) contains a list of potentially visible polygons. When the player moves from one cube to another, the previous cube's polygon are hidden and the next cube's polygons are shown.

The cool thing about CSP is that it works on any type of geometry and is very flexible at a high level. The trick is acquiring the list of potentially visible polygons and myself and few others have developed a algorithm/process to automatically acquire this data.
;frankie t's identify color by uniqueness (icu) algorithm
array vis(n,n,n)
global worldscale#=.1

loadanimmesh levelmap.b3d

for each childmesh within mesh
	apply unique color equal to childmesh index
	set childmesh attributes to fullbright, flat shading, disable fog, disable backface culling, no texture
next

repeat 
	increment camera through level map geometry on x,y,z planes
	cameraPosition camera,{camera.increment * worldscale#}
	vis(camera.increment.x%,camera.increment.y%,camera.increment.z%)=create bank
	for cameraAngles% = 1 to 6;(up,down,left,right,front,behind)
		cameraAngle camera
		snapshot=cameraSnapshot(camera)
		for each snapshot
			for x = 0 to snapshotWidth
				for y = 0 to snapshotHeight
					color%=readpixel(snapshot,x,y)
					if color>0 and not on vis(camera.increment.x%,camera.increment.y%,camera.increment.z%)
						poke(vis(camera.increment.x%,camera.increment.y%,camera.increment.z%),++,color)
					endif					
				next
			next	
		next
	next
until camera completes level