[x3d-public] add 'hidden' field to Shape?

Michalis Kamburelis michalis.kambi at gmail.com
Fri Dec 13 07:45:24 PST 2019


Castle Game Engine / view3dscene also support "Shape.render". It is
often just easier to use than Switch -- just toggle a bolean to hide
something. See https://castle-engine.io/x3d_implementation_shape_extensions.php
. We don't support "render" on a grouping node (yet).

Instant Reality (like X3DOM of course) supports "render" for both
"Shape" and grouping nodes (
http://doc.instantreality.org/documentation/nodetype/Shape/ ,
http://doc.instantreality.org/documentation/nodetype/Group/ ).

As for the DEF/USE behavior: since DEF/USE implies that we have only
one Shape node (just instantiated many times), so toggling
"Shape.render" indeed hides all the instances. In your example, it
would hide all wheels. Whether this is useful -- depends on the
author's needs. As you say, if necessary, author has to wrap each
wheel in a "Switch" (or in "Group", in case of X3DOM / Instant
Reality) to toggle visibility of each instance independently.

Regards,
Michalis

pt., 13 gru 2019 o 12:18 vmarchetti at kshell.com <vmarchetti at kshell.com>
napisał(a):
>
> 1. There is a extension attribute in X3DOM called the 'render' attribute which serves this purpose, with opposite parity (meaning render=true has the same effect as hidden=false). It is higher up in the X3DOM inheritance tree, (see https://doc.x3dom.org/author/Grouping/X3DBoundedObject.html ) so it is an attribute in both the ShapeNode and the grouping nodes.
>
> 2. To add this field to Shape, and potentially the grouping nodes, we would need to specify how it behaves when the Shape node is referenced multiple times in a Scene with DEF/USE statements. This is a common pattern when a Shape is something which is repeated multiple times, think tires on a car. However, if 'hidden' is defined as a field on the Shape then all the tires would be shown/hidden together, which may not be the desired effect. If the authoring solution to avoid this is to enclose each tire in its own Group node and apply hidden on that Group, then you're pretty much back to the existing design pattern available with the Switch node.
>
> Vince Marchetti
>
> On Dec 12, 2019, at 11:23 AM, Don Brutzman <brutzman at nps.edu> wrote:
>
> A common task in 3D graphics is selectively hiding geometry.
>
> X3D is fairly clumsy about this, typically requiring Switch or LOD animation to achieve it.
>
> HTML has a much simpler approach, the 'hidden' attribute.  There is a similar construct in CSS.
>
> HTML5 6.1 The hidden attribute
> https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute
>
> As a similar way to simplify hidding, either for pure X3D or hybrid html/X3D, wondering if we might add a 'hidden' attribute to Shape.
>
> 12.4.6 Shape
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD1/Part01/components/shape.html#Shape
>
> SFBool [in out] hidden FALSE
>
> Might we add hidden to Shape?  Is there a better approach?
>
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org



More information about the x3d-public mailing list