View Single Post
  #1  
Old 10-08-2014, 05:26 PM
chris2307 chris2307 is offline
Member
 
Join Date: Nov 2013
Posts: 36
viz intersect object point

Hi all,

I am trying to return a list of 100 intersections based on 100 points that stretch across the centre of the screen.

However, when I print the points out, I get a list of values which are not right. The Y coordinate seems correct but the X and Z coordinates usually float between 0 and 1. I know this isn't correct because I can load the model up in the explorer and see that the general area where I am returning these points are nowhere near these tiny values.

Here is the code
Code:
	def _calculateDropPositions2(self):
		screenUnitX = 0
		intersections = []
		self.worldPositions = []
		
		for index in range(100):
			screenUnitX += 0.01
			obj = viz.pick(pos = [screenUnitX, 0.5], info = True)
			if(obj.valid):
				intersections.append(obj.point)
		
		for i in intersections:
			print i
And here is the output.

Code:
[-0.48842981457710266, 1.819377064704895, 1.026976227760315]
[-0.47847452759742737, 1.819377064704895, 1.0269761085510254]
[-0.46851930022239685, 1.819377064704895, 1.026976227760315]
[-0.4585641026496887, 1.819377064704895, 1.026976227760315]
[-0.4486088752746582, 1.819377064704895, 1.0269763469696045]
[-0.43865352869033813, 1.819377064704895, 1.0269761085510254]
[-0.42869833111763, 1.819377064704895, 1.026976227760315]
[-0.4187431335449219, 1.819377064704895, 1.026976227760315]
[-0.40878787636756897, 1.819377064704895, 1.026976227760315]
[-0.3988325893878937, 1.819377064704895, 1.0269761085510254]
[-0.38887736201286316, 1.819377064704895, 1.0269761085510254]
[-0.37892210483551025, 1.819377064704895, 1.0269761085510254]
[-0.36896681785583496, 1.819377064704895, 1.0269759893417358]
[-0.3590116798877716, 1.819377064704895, 1.026976227760315]
[-0.3490564227104187, 1.819377064704895, 1.026976227760315]
[-0.3391011655330658, 1.819377064704895, 1.026976227760315]
[-0.3291459083557129, 1.819377064704895, 1.0269761085510254]
[-0.31919065117836, 1.819377064704895, 1.0269761085510254]
[-0.30923545360565186, 1.819377064704895, 1.026976227760315]
[-0.29928022623062134, 1.819377064704895, 1.026976227760315]
[-0.28932496905326843, 1.819377064704895, 1.026976227760315]
[-0.2793697714805603, 1.819377064704895, 1.0269763469696045]
[-0.2694145143032074, 1.819377064704895, 1.0269763469696045]
[-0.2594592869281769, 1.819377064704895, 1.0269763469696045]
[-0.2495039999485016, 1.819377064704895, 1.026976227760315]
[-0.23954877257347107, 1.819377064704895, 1.026976227760315]
[-0.22959351539611816, 1.819377064704895, 1.026976227760315]
[-0.21963827311992645, 1.819377064704895, 1.0269761085510254]
[-0.20968303084373474, 1.819377064704895, 1.0269761085510254]
[-0.19972778856754303, 1.819377064704895, 1.026976227760315]
[-0.1897725760936737, 1.819377064704895, 1.0269763469696045]
[-0.1798172891139984, 1.819377064704895, 1.0269759893417358]
[-0.1698620468378067, 1.819377064704895, 1.0269761085510254]
[-0.15990683436393738, 1.819377064704895, 1.026976227760315]
[-0.14995160698890686, 1.819377064704895, 1.026976227760315]
[-0.13999632000923157, 1.819377064704895, 1.0269761085510254]
[-0.13004107773303986, 1.819377064704895, 1.0269759893417358]
[-0.12008585780858994, 1.819377064704895, 1.0269759893417358]
[-0.11013064533472061, 1.819377064704895, 1.0269761085510254]
[-0.10017537325620651, 1.819377064704895, 1.0269761085510254]
[-0.09022015333175659, 1.819377064704895, 1.026976227760315]
[-0.08026493340730667, 1.819377064704895, 1.0269763469696045]
[-0.07030964642763138, 1.819377064704895, 1.0269759893417358]
[-0.060354430228471756, 1.819377064704895, 1.026976227760315]
[-0.05039920285344124, 1.819377064704895, 1.026976227760315]
[-0.04044393077492714, 1.819377064704895, 1.0269761085510254]
[-0.030488697811961174, 1.819377064704895, 1.0269759893417358]
[-0.020533477887511253, 1.819377064704895, 1.026976227760315]
[-0.010578212328255177, 1.819377064704895, 1.0269763469696045]
[-0.0006229812279343605, 1.819377064704895, 1.0269761085510254]
[0.009332248009741306, 1.819377064704895, 1.026976227760315]
[0.0192874763160944, 1.819377064704895, 1.026976227760315]
[0.029242701828479767, 1.819377064704895, 1.0269761085510254]
[0.03919801488518715, 1.819377064704895, 1.0269763469696045]
[0.04915324226021767, 1.819377064704895, 1.026976227760315]
[0.059108465909957886, 1.819377064704895, 1.026976227760315]
[0.0690636932849884, 1.819377064704895, 1.0269761085510254]
[0.07901893556118011, 1.819377064704895, 1.0269763469696045]
[0.08897414058446884, 1.819377064704895, 1.0269761085510254]
[0.09892946481704712, 1.819377064704895, 1.026976227760315]
[0.10888469219207764, 1.819377064704895, 1.026976227760315]
[0.11883990466594696, 1.819377064704895, 1.0269761085510254]
[0.12879514694213867, 1.819377064704895, 1.026976227760315]
[0.1387503743171692, 1.819377064704895, 1.026976227760315]
[0.1487055867910385, 1.819377064704895, 1.0269761085510254]
[0.1586609035730362, 1.819377064704895, 1.0269761085510254]
[0.1686161309480667, 1.819377064704895, 1.026976227760315]
[0.17857134342193604, 1.819377064704895, 1.0269761085510254]
[0.18852655589580536, 1.819377064704895, 1.0269759893417358]
[0.19848179817199707, 1.819377064704895, 1.0269761085510254]
[0.20843705534934998, 1.819377064704895, 1.026976227760315]
[0.21839237213134766, 1.819377064704895, 1.026976227760315]
[0.22834758460521698, 1.819377064704895, 1.026976227760315]
[0.23830284178256989, 1.819377064704895, 1.0269763469696045]
[0.24825803935527802, 1.819377064704895, 1.026976227760315]
[0.25821325182914734, 1.819377064704895, 1.0269761085510254]
[0.26816847920417786, 1.819377064704895, 1.0269761085510254]
[0.27812373638153076, 1.819377064704895, 1.026976227760315]
[0.2880789637565613, 1.819377064704895, 1.0269759893417358]
[0.2980342507362366, 1.819377064704895, 1.0269761085510254]
[0.3079895079135895, 1.819377064704895, 1.026976227760315]
[0.3179447054862976, 1.819377064704895, 1.026976227760315]
[0.3278999626636505, 1.819377064704895, 1.026976227760315]
[0.33785513043403625, 1.819377064704895, 1.0269761085510254]
[0.34781044721603394, 1.819377064704895, 1.0269761085510254]
[0.35776570439338684, 1.819377064704895, 1.026976227760315]
[0.36772096157073975, 1.819377064704895, 1.026976227760315]
[0.3776760995388031, 1.819377064704895, 1.0269759893417358]
[0.3876313865184784, 1.819377064704895, 1.0269761085510254]
[0.3975866138935089, 1.819377064704895, 1.0269761085510254]
[0.4075419306755066, 1.819377064704895, 1.026976227760315]
[0.4174971282482147, 1.819377064704895, 1.0269761085510254]
[0.42745229601860046, 1.819377064704895, 1.0269759893417358]
[0.43740764260292053, 1.819377064704895, 1.026976227760315]
[0.44736286997795105, 1.819377064704895, 1.026976227760315]
[0.4573180675506592, 1.819377064704895, 1.026976227760315]
[0.4672732949256897, 1.819377064704895, 1.0269759893417358]
[0.4772286117076874, 1.819377064704895, 1.026976227760315]
[0.48718389868736267, 1.819377064704895, 1.0269763469696045]
[0.4971390962600708, 1.819377064704895, 1.026976227760315]
I am using the <window>.frustum() function to set my viewing frustum. Could this be affecting it? Any thoughts on this?
Reply With Quote