[x3d-public] v4 > X3DGroupingNode > displayBBox, visible

GPU Group gpugroup at gmail.com
Thu May 7 11:18:38 PDT 2020


my experience implementing displayBBox, visible in freewrl:

Results:

http://dug9.users.sourceforge.net/web3d/tests/bbox/BasicBrain_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/2.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/BoxMan_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/CadTeapot_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/GeoLocation_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/linepickD_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/ProtoInlineBillboardAnchorShape_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/Viewport_displayBBox.x3d
http://dug9.users.sourceforge.net/web3d/tests/bbox/screenshot_displayBBox.jpg

Method:
It took a week of careful gruelling refactoring of old inefficient code -42
Git commits- but was a good opportunity to clean up some old mess build up
over a decade of incremental hacking.
OLD:
X loop over all nodes once per frame propagated extents up through
transforms
X regenerating transforms to transform the extents on transform-type nodes
X we weren't even using group bboxSize and bboxCenter
NEW:
*Groups:  on render pass, push an empty bounding box onto a stack before
drawing children, and the children UNION with their own extent and pass
back on the stack
*Transforms: like group, except when preparing the transform, keep the
additional transforms separate from MODELVIEWMATRIX to apply to just the
extent when it comes back
** and use it to transform extent by converting to an 8 point rectanguloid,
and transform all 8 points, then take the extent of them
https://sourceforge.net/p/freewrl/git/ci/develop/tree/freex3d/src/lib/scenegraph/Component_Grouping.c

L.492 prep_BBox, fin_BBox


31 changes:
G - group type, just copy children extent to parent scope
T - transform type, transform children extent to parent scope

1 Anchor *G
2 Billboard *T
3 Collision *G
4 Group *G
5 Switch *G
6 Transform *T
7 Viewport *G
8 Inline *G
9 LOD *G
10 StaticGroup *G
11 PickableGroup *G
12 Proto *G (just x3d parsed protoInstance)
13 Shape *G


14 CADAssembly *G
15 CADFace *G
16 CADLayer *G (MFBool [] visible renamed MFBool visibles [])
17 CADPart *T

18 GeoLOD *G
19 GeoLocation  *T
20 GeoTransform *T2 (a 2-step transform of extent)
+  freewrl GeoPlanet *T

21 HAimHumanoid *G (except unsegmented skin)
22 HAnimJoint *T
23 HAnimSegment *G
24 HAnimSite *T

25 ReceiverPdu x doesn't need no children
26 SignalPdu x doesn't need no children
27 TransmitterPdu x doesn't need no children
28 EspduTransform *T (not tested, not applied to geo transform just regular)

29 VolumeData *G
30 SegmentedVolumeData *G
31 IsoSurfaceVolumeData *G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200507/ff3ab3ff/attachment.html>


More information about the x3d-public mailing list