View Single Post
  #19  
Old 09-12-2006, 06:52 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I can't replicate your problem. I downloaded your model and made the thickness of the wall to 1.0. I then setup a timer that would perform a 180 degree sweep of intersection tests based on the current view position/orientation. I spent a minute navigating through the maze and never got a missed intersection. Here's the script I used to test it out:
Code:
import viz
import math
viz.go()

wall = viz.add('wall_thick.wrl')
wall.collideMesh()
wall.disable(viz.DYNAMICS)

viz.MainView.translate(10.5,1.3,-21.0)

def SweepIntersection():

	#Get begin point for intersection test
	begin = viz.MainView.getPosition()
	bx = begin[0]
	by = begin[1]
	bz = begin[2]
	
	#Get point 100 units ahead of viewpoint
	forward = viz.Vector(viz.MainView.getMatrix().getForward(),length=100)
	px = forward[0]
	pz = forward[2]
	
	for deg in range(-90,90):
		
		#Rotate ahead point by deg (Assume no pitch/roll)
		rad = viz.radians(deg)
		x = math.cos(rad)*px - math.sin(rad)*pz 
		z = math.sin(rad)*px + math.cos(rad)*pz
		
		#Calculate end point
		ex = bx + x
		ez = bz + z
		
		#Perform intersection
		info = viz.phys.intersectLine(begin,(ex,by,ez))
		
		#Check if intersection is not valid
		if not info.valid:
			print 'NO INTERSECTION'

vizact.ontimer(0,SweepIntersection)
Does this problem only occur under certain conditions or is it pretty much random?
Reply With Quote