WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
Old 02-09-2006, 09:03 AM
Geoffrey Geoffrey is offline
Join Date: Feb 2006
Posts: 8
retrieve Object names


I want to know wich object is under given screencoordinates.
(In this test-case these are the mousecoordinates..)
How can I access the name of the object ??

import viz


Cube1 = viz.add('')
Cube2 = viz.add('')
Cube3 = viz.add('')


def mijntimer(num):
	line = viz.screentoworld(viz.mousepos())
	begin = line[:3]
	end = line[3:]
	info = viz.intersect(begin,end)
	if info.intersected:
		print 'you are over object : ',
		#mijntest = info.object
		#mijntest.Name() ...??
		#I want the name of the object.. Cube1, Cube2 or Cube3
for now the output is :

Loading File:
Loading File:
Loading File:
** Load Time: 0.38 seconds
you are over object :  0
you are over object :  1
you are over object :  2
you are over object :  2
you are over object :  1
you are over object :  2
I would like it to be :
you are over object : Cube1
you are over object : Cube2
you are over object : Cube3

can anyone help me ?


btw : I attached the file but changed the extention to txt (otherwise I could not attach it)
Attached Files
File Type: txt theCube.txt (2.0 KB, 4414 views)
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 08:21 AM.

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