Welcome, Guest! Log In | Create Account

Ticket #26 (closed patch: fixed)

Opened 8 months ago

Last modified 2 months ago

WireBoundingBox.cs

Reported by: andris11 Owned by: andris11
Priority: major Milestone: 0.8.0.0-B1
Component: Core Library Version: 0.8.0.0 (crickhollow)
Keywords: Cc:

Description (last modified by borrillis) (diff)

The rendered bounding box was increasing in size over the underlying AABB by a constant of 2 units. For small-scale entities this was causing troubles - the rendered box was easily getting times as big as the entity.

The patch fixes this by increasing the rendered box by a percentage of the underlying AABB's size. Currently by 2% .

See forum thread for more info
http://axiomengine.sourceforge.net/forum/viewtopic.php?f=1&t=586

The patch is applicable to Crickhollow SVN HEAD revision changeset:1552

Attachments

WireBoundingBox.patch (12.4 KB) - added by andris11 8 months ago.
WireBoundingBoxTest.jpg (57.2 KB) - added by andris11 8 months ago.
WireBoundingBox_SettableColor.patch (16.9 KB) - added by andris11 8 months ago.
WireBoundingBoxTest.patch (3.4 KB) - added by andris11 8 months ago.

Change History

Changed 8 months ago by andris11

Changed 8 months ago by andris11

Changed 8 months ago by andris11

Changed 8 months ago by andris11

Changed 8 months ago by andris11

  • type changed from defect to patch

Continuing on fixing problems in WireBoundingBox?, the InitAABB() method was unnecessarily reseting vertex colors with ColorEx?.Red, executed per visible bounding box each frame. Also the material was "BaseWhite?" with lighting enabled therefore the vertex colors could not have an effect at all.

This patch fixes that behavior by using "BaseWhiteNoLighting?" as the material and optimizes color buffer access. It encompasses corrections to the initial issue of course.

Also, since that was pretty easy to implement, I've further modified the WireBoundingBox?, so that it's color is now settable. Users can set the color of the bounding box in SceneNode?.BoundingBoxColor?, so you can have different AABB colors for each scene node. Should be handy if you want visually distinguish groups of objects, can also be used to do some flashing effects, the included demo shows that approach.

Don't see how to delete the old WireBoundingBox?.patch, just adding the new files.

Should be all fine, hope you like it :)

crickhollow SVN 1555

Changed 8 months ago by andris11

Yet, the default color of the AABB is now white, I thought it's an intentional change for crickhollow and liked it. The default color can be changed in the static WireBoundingBox?.DefaultColor?

Changed 8 months ago by borrillis

  • version set to 0.8.0.0 (crickhollow)
  • description modified (diff)

Changed 4 months ago by borrillis

Is this patch still needed?

Changed 4 months ago by andris11

Yes I think so. The bounding box's custom color feature should be appreciated. Imagine scene editor features - show bounds of all objects while showing bounds of the currently selected objects in different color.

Size increase of the visible box over the actual object bounds in percents shall be usefull if having cuboids in the scene (as one example) - it ensures the bounding box's visibility.

However I'm not convinced about the current 2% size increase. That was ment to mimic previous behaviour. Should be less than that, so that visually the box doesn't appear greater than the entity.

Want to return to the patch yet.

Changed 4 months ago by andris11

  • owner changed from borrillis to andris11
  • status changed from new to assigned

Changed 2 months ago by borrillis

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.