WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-31-2013, 09:55 PM
javadi javadi is offline
Member
 
Join Date: Mar 2013
Location: London
Posts: 33
Grouping Objects

Hi,

I am wondering how one can group a set of objects? I want to group them so that I can control their visibility using one command. I am also interested in grouping quads. I have to mention that I don't care about collisions.

One solution that I use at the moment is to create an object as "parent" and assign the rest of the objects to it as its "children". Then, you can control the visibility of all the objects (parent and children) by visibility of the parent. But I am wondering how one can avoid creating a parent and rather create a group of objects/quads. Thanks.

Greetings,
Reply With Quote
  #2  
Old 04-01-2013, 11:35 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You can create a group node for this:
Code:
import viz
import vizact
viz.go()

group = viz.addGroup()
soccerball = viz.addChild('soccerball.osgb',pos=[-0.5,1.8,1.5],parent=group)
basketball = viz.addChild('basketball.osgb',pos=[0,1.8,1.5],parent=group)
volleyball = viz.addChild('volleyball.osgb',pos=[0.5,1.8,1.5],parent=group)

vizact.onkeydown(' ',group.visible,viz.TOGGLE)
Reply With Quote
  #3  
Old 04-01-2013, 01:44 PM
javadi javadi is offline
Member
 
Join Date: Mar 2013
Location: London
Posts: 33
Quote:
Originally Posted by Jeff View Post
You can create a group node for this:
Code:
import viz
import vizact
viz.go()

group = viz.addGroup()
soccerball = viz.addChild('soccerball.osgb',pos=[-0.5,1.8,1.5],parent=group)
basketball = viz.addChild('basketball.osgb',pos=[0,1.8,1.5],parent=group)
volleyball = viz.addChild('volleyball.osgb',pos=[0.5,1.8,1.5],parent=group)

vizact.onkeydown(' ',group.visible,viz.TOGGLE)
Great. Thanks for your detailed reply. I appreciate it.

I have a question. Where can I find the list of keywords - such as 'pos' - that I can use for adjustment of children, like orientation? I suppose 'pos' here is similar to 'preTrans' for links. We have a lot of freedom with links, how is it with children in relation to parents defined as such?

Cheers,
Reply With Quote
  #4  
Old 09-17-2013, 07:14 AM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
Hello, what if I am concerned about collisions? I have a car and I want to take it over a cylindrical surface. How do I incorporate collision in a way that my car (object) moves over the cylinder such that the cylinder is a road.
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble picking text3d objects Salvar Vizard 4 12-01-2010 03:07 PM
static or dynamic objects shahramy Vizard 2 11-10-2010 12:32 AM
Semi-circle array containing target and distractor objects ptjt255 Vizard 3 08-04-2009 03:09 AM
multiple objects durf Vizard 1 04-10-2009 01:42 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 11:01 AM


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


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