[osg-users] Arrays in OpenSceneGraph
Brian R Hill
bhill22 at csc.com
Tue May 6 05:23:11 PDT 2008
Daniel,
Array's are contiguous and will have better memory performance when the
array data doesn't change. Your approach of using a list to manipulate the
data then copy to the array is what I use for similar applications.
Keep your data in the list and only copy it to the array when it changes.
If your data changes frequenty (every frame), then disable display lists,
otherwise it might be better to dirty the display list when the data
changes. Measure the time to determine what's fastest.
Brian
-----osg-users-bounces at lists.openscenegraph.org wrote: -----
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
From: Daniel Moos <danimoos at gmx.ch>
Sent by: osg-users-bounces at lists.openscenegraph.org
Date: 05/06/2008 05:11AM
Subject: [osg-users] Arrays in OpenSceneGraph
Hello
I have a little question about the osg::Array in OpenSceneGraph. In
our project we must delete some triangles and normales from an
geometry. For that we use iterators and the erase() function. Now we
have a big performance problem.
To delete 12'000 triangles with its normales, we have 70'000ms.
If i first copy the hole triangles to a std::list, delete the
triangles and then copy them back to the osg::DrawElementsUInt
structure we only have 100ms.
The std::vector work with linear time and the std::list with constant
time, which is much faster.
Now my question. Why use the osg::Array a std::vector and not a
std::list?
I'm shure there is a good reason... But I haven't got a clue.
Thanks & Have a nice day
Daniel Moos_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
More information about the osg-users
mailing list