WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-10-2008, 01:39 AM
dan12345 dan12345 is offline
Member
 
Join Date: Jan 2008
Posts: 58
optimizing the loading of .wrl files

Hi
I'm trying to program an enviorment that supports adding multiple
instances of a .wrl image ( around 100-150 , and dynamically, during
the run of the program ).
The problem is that it takes a very long time and disrupts the flow of the program

adding for example 50 such objects using the "node3d.add(nameOfWlr)" takes about 5 seconds - it just seems a bit wasteful, since it is always the same .wrl file, and each time it loads it anew from the file into vizard. Is there any way to optimize this?
thanks
dan
Reply With Quote
  #2  
Old 06-10-2008, 10:00 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The most optimal change would be to clone the existing model. However, changing the appearance of one object will affect all its clones. If you want to make unique appearance changes to each model, then the second best thing is to make a copy of the existing model. Here is sample code that will add 50 objects of the same file using the clone technique:
Code:
for x in range(50):
    model = viz.add('model.wrl',cache=viz.CACHE_CLONE)
Here is similar code that will add 50 objects of the same file using the copy technique:
Code:
for x in range(50):
    model = viz.add('model.wrl',cache=viz.CACHE_COPY)
Reply With Quote
  #3  
Old 06-10-2008, 11:36 PM
dan12345 dan12345 is offline
Member
 
Join Date: Jan 2008
Posts: 58
perfect

perfect, thanks
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 loading vrml files generated by ProE tavaksai Vizard 12 12-09-2008 11:11 AM
Loading .3ds-Files without interrupting Program flow Stefan Vizard 10 06-08-2005 04:44 PM
Error when playing wav files...? vjonshih Vizard 1 05-23-2005 12:21 PM
loading large wav files in vizard tommahhh Vizard 1 05-16-2005 03:23 PM
Including Files that Include Other Files vjosh Vizard 1 09-21-2004 04:44 PM


All times are GMT -7. The time now is 04:03 AM.


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