Wrong interpolation in MeshDrawer::stream

Bug #730255 reported by Chusslove Illich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Undecided
Unassigned

Bug Description

The formula used to distribute billboards along the line segment in
MeshDrawer::stream is incorrect. Attached the patch based on current VCS
code.

On a side note, one can work around the bug in current Panda releases by
specifying suitably adjusted start point. Instead of:

  generator.stream(start, stop, ...)

use

  startmod = stop - (start - stop) / (start - stop).length()**0.5
  generator.stream(startmod, stop, ...)

Revision history for this message
Chusslove Illich (caslav-ilic) wrote :
rdb (rdb)
Changed in panda3d:
assignee: nobody → Treeform (starplant)
Revision history for this message
Treeform (starplant) wrote : Re: [Bug 730255] Re: Wrong interpolation in MeshDrawer::stream

I never really used it myself, and i think this function should be
removed. You can implement this yourself using billboard on user
side.

On Wed, Mar 9, 2011 at 6:31 AM, rdb <email address hidden> wrote:
> ** Changed in: panda3d
>     Assignee: (unassigned) => Treeform (starplant)
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/730255
>
> Title:
>  Wrong interpolation in MeshDrawer::stream
>

Revision history for this message
Chusslove Illich (caslav-ilic) wrote :

I was under impression that the main point of having MeshDrawer in C++ is
about speed. E.g. here is a little comparions of time-per-frame when using
MeshDrawer::stream vs. inner Python loop with MeshDrawer::billboard:

  case MeshDrawer::stream inner Python loop
  30 streams, 10 billb. 1.18 ms 1.81 ms
  10 streams, 30 billb. 0.97 ms 1.79 ms

Of course, the larger the inner loop compared to the outer loop, the more
the speed in favor of C++ implementation.

(I was even thinking of proposing some yet more specific extensions to
MeshDrawer, for no other reason than speed...)

Revision history for this message
Treeform (starplant) wrote :

Thanks for the experiment. Wow using c++ stream vs the python stream
is almost x2 faster. Actually how i want to see mesh drawer shape out
is mesh-drawer + node-brushes.

Basically you have this MeshDrawer node under which you attach couple
of MeshBrushes. MeshBrushes would come in the flavor of current
MeshDrawer functions like billboard, segments, rotate billboard, and
have different animation flags or motion flags on them.

In python you basically attach all this stuff together and press play
and the mesh drawer does all the drawing, animation and motion. You
can choose to adjust the brushes python side or not. This would
eliminate even more python/C++ calls. I also want to move this more
into the GPU so that shaders can draw, animate and do simple motion
there. But python would adjust the brushes when needed.

What do you think?

On Wed, Mar 9, 2011 at 11:26 AM, Chusslove Illich <email address hidden> wrote:
> I was under impression that the main point of having MeshDrawer in C++ is
> about speed. E.g. here is a little comparions of time-per-frame when using
> MeshDrawer::stream vs. inner Python loop with MeshDrawer::billboard:
>
>  case                    MeshDrawer::stream   inner Python loop
>  30 streams, 10 billb.              1.18 ms             1.81 ms
>  10 streams, 30 billb.              0.97 ms             1.79 ms
>
> Of course, the larger the inner loop compared to the outer loop, the more
> the speed in favor of C++ implementation.
>
> (I was even thinking of proposing some yet more specific extensions to
> MeshDrawer, for no other reason than speed...)
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/730255
>
> Title:
>  Wrong interpolation in MeshDrawer::stream
>

Revision history for this message
rdb (rdb) wrote :

Fixed in pull request by nikolm:
https://github.com/panda3d/panda3d/pull/14

Changed in panda3d:
assignee: Treeform (starplant) → nobody
milestone: none → 1.9.0
status: New → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.