OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Appending dynamic 3d line


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
ertanataman
Newbie


Joined: 10 Jan 2018
Posts: 2

PostPosted: Thu Jan 11, 2018 2:23 pm    Post subject:
Appending dynamic 3d line
Reply with quote

Hi,

In the program I append random points to my line sements array( Route instance) and after a while it stucks (and I think appends(0,0,0) as the last point but not very sure about its coordinate.)

The strange thing is when I increase the frequency (decrease STEP_DURATION), the number of drawn segments increases. I think something is corrupted but could not find the reason.


I also attached 3 screenshots for 1, 100 and 1000(May not be really 1000) frames per second. By changing STEP_DURATION, the change in numbers of line segments can be seen.

All I want is to be able to append my segments forever without the undesired other point.


My problem is possibly same with another topic(viewtopic.php?t=2190&postdays=0&postorder=asc&start=0) in this forum but with a new clue. Since an other problem is appended there I created a new topic.
And attached Route.cpp is Route.cpp, based on a source code(//files/osgdinamicline_180.cpp) in the topic, shared on that topic. Since it is my first post I can not share their url's here

Thank you!

Cheers,
Ertan[/img][/code][/quote]
Back to top
View user's profile Send private message Send e-mail
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11311

PostPosted: Thu Jan 11, 2018 3:09 pm    Post subject:
Appending dynamic 3d line
Reply with quote

Hi Ertan,

Just had a quick look at your .cpp file.

General comments : You don't need to add VertexArray and ColorArray as
well as VertexAttribArray for each of the vertex and color arrays.
You only need to use VertexAttirb's when using shaders that you
specifically want to name differently than the defaults. My
recommendation would be to just use the setVertexArray/setColorAray,
You also don't need to pass the ColorBinding twice - passing it as a
parameter of setColorArray is sufficient.

The next thing I would recommend is when doing dynamic data you
shouldn't use display lists, so just do a
geometry->setUseDisplayLists(false) and then you don't need to call
dirtyDisplayList() and there won't be any performance blimps that
would happen each time the display list is regenerated.

Make these changes are things should run smoother.

Robert.

On 11 January 2018 at 14:24, Ertan Ataman <> wrote:
Quote:
Hi,

In the program I append random points to my line sements array( Route instance) and after a while it stucks (and I think appends(0,0,0) as the last point but not very sure about its coordinate.)

The strange thing is when I increase the frequency (decrease STEP_DURATION), the number of drawn segments increases. I think something is corrupted but could not find the reason.


I also attached 3 screenshots for 1, 100 and 1000(May not be really 1000) frames per second. By changing STEP_DURATION, the change in numbers of line segments can be seen.

All I want is to be able to append my segments forever without the undesired other point.


My problem is possibly same with another topic(viewtopic.php?t=2190&postdays=0&postorder=asc&start=0) in this forum but with a new clue. Since an other problem is appended there I created a new topic.
And attached Route.cpp is Route.cpp, based on a source code(//files/osgdinamicline_180.cpp) in the topic, shared on that topic. Since it is my first post I can not share their url's here

Thank you!

Cheers,
Ertan[/img][/code]


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72728#72728




Attachments:
http://forum.openscenegraph.org//files/randomroutes_with_different_fpss_837.jpg
http://forum.openscenegraph.org//files/route_762.cpp



[/quote]

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
ertanataman
Newbie


Joined: 10 Jan 2018
Posts: 2

PostPosted: Thu Jan 11, 2018 3:58 pm    Post subject:
Reply with quote

Hi
I updated my code and reattached. No Improvement:(
Also after removing dirtyDisplayList, just few segments are shown.

Yes. Since I tried on many solutions I left unnecessary lines
Quote:
General comments : You don't need to add VertexArray and ColorArray as
well as VertexAttribArray for each of the vertex and color arrays.
You only need to use VertexAttirb's when using shaders that you
specifically want to name differently than the defaults. My
recommendation would be to just use the setVertexArray/setColorAray,
You also don't need to pass the ColorBinding twice - passing it as a
parameter of setColorArray is sufficient.


About setUseDisplayLists function:
I already called setUseDisplayList (wihout plural suffix -s at the end).
setUseDisplayLists does not exist in osg include directories.
Also calling setUseDisplayList each step did not differ so I removed it.


Quote:
The next thing I would recommend is when doing dynamic data you
shouldn't use display lists, so just do a geometry->setUseDisplayLists(false)




If I do not call dirtyDisplayList or setVertexArray just few line segments are drawn and possibly they are not mines.

Quote:
and then you don't need to call
dirtyDisplayList() and there won't be any performance blimps that
would happen each time the display list is regenerated.


I've forgotten to mention that I run the code under both Ubuntu and Windows and have same result.

Thanks.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Normal Mapping using Dynamic Cubemap romulogcerqueira General 6 Tue Dec 19, 2017 2:10 am View latest post
No new posts export to wavefront (obj) of line obj... MNicke General 0 Tue Dec 05, 2017 4:18 pm View latest post
No new posts Dynamic Cubemap with OSG and Shader romulogcerqueira General 0 Tue Dec 05, 2017 1:27 am View latest post
No new posts [vpb] Command-line fixes Andreas Ekstrand Submission 0 Sat Sep 30, 2017 2:56 pm View latest post
No new posts Command line option for inputing X/Y ... vinothrajendran4 VirtualPlanetBuilder [vpb] 0 Wed Jan 25, 2017 7:16 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP