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

[EMAIL PROTECTED] wrote: -----


To: OpenSceneGraph Users <[email protected]>
From: Daniel Moos <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
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
[email protected]
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.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to