WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #13  
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:01 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC