WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-24-2009, 01:25 PM
durf durf is offline
Member
 
Join Date: Feb 2009
Posts: 61
.clone() or .copy()

Hello,

Im writing a program that adds a node3d and lets the node run for 3.5 seconds and then removes the node3d when its triggered by some speed. The node is also looping animation(IE it appears then disappears, then does it over and over again).

The problem Im having is its causing my program to slow down and get laggy. When i try .clone() it takes wherever the orginal node is in its loop and starts it from that point. When i try .copy() the node never starts its animation. The node appears but never loops.

I just want it to run faster.

This is the way I have the code right now. Its goes slow when I run this.
Code:
if obj.speed > 1 and obj.speed < 2.5:
     def showFlower():
	flower1 = viz.add('flower_grow_01.wrl')  #ADDS
	flower1.scale(.06,.06,.06)

	x,y,z = ball1.getPosition()
				
	if z < 0:
             	flower1.setPosition([x,0,-10])
	if z >= 0:
		flower1.setPosition([x,0,10])
				
	a,b,c = int1.getEuler()  #add
	flower1.setEuler(a,0,0)  #add
				
	yield viztask.waitTime( 3.5 )
	flower1.remove()                      #REMOVES 
				
viztask.schedule( showFlower() )
Any help is much appreciated.

Thanks
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 03:25 AM.


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