Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Masters Of The Universe (http://www.linux-archive.org/ubuntu-masters-universe/)
-   -   Possible Stage issue (http://www.linux-archive.org/ubuntu-masters-universe/576406-possible-stage-issue.html)

Bryan Burke 09-15-2011 09:02 PM

Possible Stage issue
 
Got this message from one of my users about the player/stage packages. They asked me to
forward along this message to you guys for review and inclusion in the PPA which hosts the
stage v3 packages (http://ppa.launchpad.net/thjc/ppa/ubuntu).

If you need anything else from me (or the user who did this), just let me know.

Thanks!

------ BEGIN MESSAGE ------

I've done a little digging in the Stage 3.2.2 source code just now, and I have found a way
to turn off the trail fading. In the world file, adding:
show_trailfast 1
to the window section will cause the trails to persist. Unfortunately, it also causes the
laser arcs to stick around as well, so in a few minutes the robot will paint the whole
screen blue with red stripes running through it.

I did a little more checking into the drawing of the trails in the non-fast mode, and I
discovered the offending lines of code. Namely, there is a fadeout factor which is a
function of the length of the trail:

double darkness = 0;
double fade = 0.5 / (double)(trail_length+1);

Later on in the code there is a modification to "darkness" which is actually the opacity
setting for the OpenGL colors:
darknes += fade;

So, as each trail checkpoint is drawn, the opacity is increased. The odd thing is, the
system still remembers all the checkpoints, and in fact it submits them all for rendering.
This definitely looks like just a bit of window dressing as it does not save any
computation or render cycles by doing this. Modifying lines 53 and 54 of
libstage/model_draw.cc to read:

double darkness = 1;
/* remove the fade line */

and then removing line 75 of the same file eliminates trail fading, and the laser arcs
stay with the robot. (this is assuming the 3.2.2 tarball of Stage's code). However,
nothing short of patching the libstage source code can prevent the fading from taking
place.

Because there is nothing to be gained by the fading, I can't help but shake my head at
whoever put this in without making a way to deactivate it!

Hope that helps on the trail front.

------ END MESSAGE ------

--
Bryan Burke
IT Administrator
Department of Electrical Engineering and Computer Science
University of Tennessee, Knoxville
bburke@eecs.utk.edu
(865) 974-4694

--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu

Bryan Burke 09-23-2011 06:42 PM

Possible Stage issue
 
> Got this message from one of my users about the player/stage packages. They asked me to
> forward along this message to you guys for review and inclusion in the PPA which hosts the
> stage v3 packages (http://ppa.launchpad.net/thjc/ppa/ubuntu).

I finally got the user to send me a patch for this. It should be attached to this email.

--
Bryan Burke
IT Staff
Department of Electrical Engineering and Computer Science
University of Tennessee, Knoxville
bburke@eecs.utk.edu
(865) 974-4694
diff -ur Stage-3.2.2-Source/libstage/model_draw.cc Stage-3.2.2-Source.new/libstage/model_draw.cc
--- Stage-3.2.2-Source/libstage/model_draw.cc 2009-10-28 16:48:05.000000000 -0400
+++ Stage-3.2.2-Source.new/libstage/model_draw.cc 2011-09-01 16:52:06.000000000 -0400
@@ -50,8 +50,8 @@

void Model::DrawTrailFootprint()
{
- double darkness = 0;
- double fade = 0.5 / (double)(trail_length+1);
+ double darkness = 1;
+/* double fade = 0.5 / (double)(trail_length+1); */

PushColor( 0,0,0,1 ); // dummy pushL just saving the color

@@ -72,7 +72,7 @@
Gl::pose_shift( pz );
Gl::pose_shift( geom.pose );

- darkness += fade;
+/* darkness += fade; */
Color c = checkpoint.color;
c.a = darkness;
glColor4f( c.r, c.g, c.b, c.a );
--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu


All times are GMT. The time now is 10:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.