WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1  
Old 10-19-2012, 02:03 AM
Batigol Batigol is offline
Member
 
Join Date: Oct 2012
Posts: 5
get object on mouse click

Hi all,

I'm very new with Vizard.
I'm trying to get object on mouse click. But I just get to root object viz.VizChild(1) not the subobject like c1,c2....
The viz.pick(info=True).name just return the name of material not object name.
How could I access to subobject?

Attached Thumbnails
Click image for larger version

Name:	mouseclick.jpg
Views:	2548
Size:	284.8 KB
ID:	539  
Reply With Quote
  #2  
Old 10-22-2012, 03:21 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the node.getChild command to get a handle to a sub-node. Example:
Code:
slider = viz.addChild('sodoku.ive')
c2 = slider.getChild('c2')
.
.
.
obj = viz.pick()
if obj == c2:
    print 'c2 picked'
Reply With Quote
  #3  
Old 10-22-2012, 07:30 PM
Batigol Batigol is offline
Member
 
Join Date: Oct 2012
Posts: 5
I already tried it. It worked.
But it is so strange to compare with other game engine
Anyway, thanks for your comments
Reply With Quote
  #4  
Old 10-25-2012, 01:14 AM
JvdBosch JvdBosch is offline
Member
 
Join Date: Sep 2006
Posts: 36
Quote:
Originally Posted by farshizzo View Post
You can use the node.getChild command to get a handle to a sub-node. Example:
Code:
slider = viz.addChild('sodoku.ive')
c2 = slider.getChild('c2')
.
.
.
obj = viz.pick()
if obj == c2:
    print 'c2 picked'
This works fine, but introduces extra drawables in the scene. With large scenes this can hurt the framerate. Is there no other way to do this? Maybe it can be on the wish-list for the next update?
Reply With Quote
  #5  
Old 10-25-2012, 09:36 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Calling getChild should not introduce more drawables. Can you post an example where it does?

This is already a feature in the upcoming Vizard 5 release. You will be able to get access to the full node hierarchy of the intersection.
Reply With Quote
  #6  
Old 10-25-2012, 08:03 PM
Batigol Batigol is offline
Member
 
Join Date: Oct 2012
Posts: 5
Quote:
Originally Posted by farshizzo View Post
Calling getChild should not introduce more drawables. Can you post an example where it does?

This is already a feature in the upcoming Vizard 5 release. You will be able to get access to the full node hierarchy of the intersection.
It's sound great
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse bug in V3 and V4 Renato Lima Vizard 2 05-11-2011 06:38 PM
grabbing the object under mouse dwaik Vizard 2 03-02-2010 01:46 AM
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
how to pick up the object, move and rotate using mouse nasr Vizard 5 05-05-2009 03:11 AM
moving and object by mouse but don't know how to stop the movement nlfrnassimi Vizard 8 04-26-2009 07:23 AM


All times are GMT -7. The time now is 12:18 AM.


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