[fixed] CBillboardSceneNode Widths Inverted

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

[fixed] CBillboardSceneNode Widths Inverted

Post by pc0de »

bug - 3469469 Setting TopEdgeWidth and Width to different values displays as inverted.

Using these parameters:

Code: Select all

 
<int name="TopEdgeWidth" value="6.000000" />
<int name="Width" value="8.000000" />
<int name="Height" value="2.000000" />
<color name="Shade_Top" value="ffffffff" />
<color name="Shade_Down" value="ffffffff" />
 
generates this:
Image

This naive update appears to fix the problem:

Code: Select all

 
Index: source/Irrlicht/CBillboardSceneNode.cpp
===================================================================
--- source/Irrlicht/CBillboardSceneNode.cpp     (revision 4026)
+++ source/Irrlicht/CBillboardSceneNode.cpp     (working copy)
@@ -99,10 +99,10 @@
        |/ |
        2--1
        */
-       vertices[0].Pos = pos + topHorizontal + vertical;
-       vertices[1].Pos = pos + horizontal - vertical;
-       vertices[2].Pos = pos - horizontal - vertical;
-       vertices[3].Pos = pos - topHorizontal + vertical;
+       vertices[0].Pos = pos + horizontal + vertical;
+       vertices[1].Pos = pos + topHorizontal - vertical;
+       vertices[2].Pos = pos - topHorizontal - vertical;
+       vertices[3].Pos = pos - horizontal + vertical;
 
        // draw
 
Image

p.s. - I forgot to login to the tracker before adding the bug and now I'm unable to update the description with a reference to this forum post...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [bug] CBillboardSceneNode Widths Inverted

Post by hybrid »

I think you can still post to the tracker new comments. Anyway, the issue seems small enough that I can handle it without the bi-directional cross reference :-) Strange anyway, as I tested the implementation after the last report about the texture issues of the trapezoid billboards.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [bug] CBillboardSceneNode Widths Inverted

Post by hybrid »

Ok, the test screenshot is indeed wrong as well. I just didn't notice it, as I would have written the parameters in a different order. So the params are actually bottom top, which should make my test output also flipped. I guess the problem is the many cross products used in the calculations. I'll go through those again and see what the proper vector output should look like. And based on that find a solution for this.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Re: [fixed] CBillboardSceneNode Widths Inverted

Post by pc0de »

Thanks for the fix. I forgot there was a billboard test - but I'm kind of glad I did because I would've gotten confused after it passed :). Thanks again.
Post Reply