WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-16-2016, 02:52 PM
RECVEB_RA RECVEB_RA is offline
Member
 
Join Date: Feb 2016
Posts: 2
Re-creating Walk-The-Plank

Hello,

I am trying to create a "walk-the-plank" virtual environment. I have made it in Sketchup 2014. The two pictures that are attached show how I would like the virtual environment to look like prior to, and after lowering the floor. Unlike the demo of walk-the-plank which also has the platform being raised, I only need the floor to be lowered. Even though I have groups in the Sketchup file, it does not seem that they transfer over into Inspector.

My question is how do I specify the "Pit" area so that when I press "1" it will be lowered, just like in the demo?

I have also posted a link to the .dae file.


Here is the code for the Walk-The-Plank demo for reference.

Thank you for your help.
Attached Thumbnails
Click image for larger version

Name:	Room without Pit Cover.jpg
Views:	849
Size:	112.0 KB
ID:	762   Click image for larger version

Name:	Room with Pit Cover.jpg
Views:	754
Size:	108.8 KB
ID:	763  
Reply With Quote
  #2  
Old 02-19-2016, 08:31 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Open the model in Inspector and in the view pane highlight the part of the model that will move up and down. Find the corresponding node that's highlighted in the scenegraph tree. Right click on that node and select 'insert above' and then 'transform' and give the transform a name. Go to File > Save As to save a new version of the model with the transform node in the scengraph. See the hierarchical models page for example code to get a handle to a transform node in the script. You can move the floor up and down by moving the transform node.
Attached Thumbnails
Click image for larger version

Name:	floor_transform.png
Views:	716
Size:	144.6 KB
ID:	766  

Last edited by Jeff; 02-19-2016 at 08:35 AM.
Reply With Quote
  #3  
Old 02-19-2016, 06:11 PM
RECVEB_RA RECVEB_RA is offline
Member
 
Join Date: Feb 2016
Posts: 2
Hi Jeff,

Thanks, I managed to specify the pit area. However, whenever I press to lower it this happens (see attached picture). I have been trying to find in the code something indicative of the final lowering point but am unable to find it. Any advice?
Attached Thumbnails
Click image for larger version

Name:	Pit.PNG
Views:	715
Size:	681.3 KB
ID:	767  
Reply With Quote
  #4  
Old 02-21-2016, 01:06 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The floor's local coordinate system does not match Vizard's. You can highlight the floor in Inspector and activate translation to see how it's axes are oriented. The following code works to drop/raise the floor:

Code:
import viz
import vizact
viz.go()

room = viz.addChild('room.osgb')
floor = room.getTransform('floor')

def dropFloor():
	floor.setPosition([0,0,0.4],viz.REL_LOCAL)
	
def raiseFloor():
	floor.setPosition([0,0,-0.4],viz.REL_LOCAL)	

vizact.onkeydown('1', dropFloor)
vizact.onkeydown('2', raiseFloor)
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
EXE creating a new folder mshukun Vizard 2 09-23-2014 06:40 AM
Walk roobert Vizard 6 08-19-2014 07:07 PM
Creating a new DLS in trial license jmay Plug-in development 3 04-30-2014 09:30 AM
Creating Realistic Turns in Vizard using walkTo mikeb Vizard 1 02-28-2014 05:51 AM
random walk in piazza environment maya Vizard 7 01-15-2014 04:58 AM


All times are GMT -7. The time now is 11:18 PM.


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