WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-03-2010, 11:18 AM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
Question Is it possible to stretch an object? How?

Hi, I have been studying the Vizard engine for quite a while now, but I can't understand how to strech objects through the code.

Imagine a 3D Chart Map, where the chart bars are objects and the information is presented on a texturized wall from where the bars pop into the 3D environment.

How can I strech these bars? I tried to use setScale but it also impacts the distance between the object and the wall, so I need to be able to control set one of its dimensions without using that command.

Any ideas?

Thank you very much.
Reply With Quote
  #2  
Old 09-03-2010, 01:03 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
When you scale the bar it's center will remain in the same position. You could either change the bar's center to be at the end that will touch the wall or re-position the bar after scaling it. The following code moves an object's center so it will stay aligned with the ground when scaled:
Code:
import viz
viz.go()

ground = viz.add('tut_ground.wrl')
box = viz.add('box.wrl',pos=[0,0.5,0],scale=[0.2,1,0.2])
box.center(0,-0.5,0)

vizact.onkeydown('1',box.setScale,0.2,1,0.2)
vizact.onkeydown('2',box.setScale,0.2,1.5,.2)
vizact.onkeydown('3',box.setScale,0.2,2,0.2)
vizact.onkeydown('4',box.setScale,0.2,2.5,0.2)


import vizcam
viz.cam.setHandler(vizcam.PivotNavigate(center=[0,1,0],distance=6))

Last edited by Jeff; 09-03-2010 at 01:06 PM.
Reply With Quote
  #3  
Old 09-05-2010, 09:28 AM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
Thank you, Jeff. It works.
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
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
Making an object to appear after other object done animating jaylocco Vizard 2 07-13-2009 06:17 PM
Child Object Rotation paulgoldberg Vizard 5 09-05-2006 11:33 AM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM


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


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