[x3d-public] string sequencer/interpolator ?

Andreas Plesch andreasplesch at gmail.com
Fri Oct 6 12:44:03 PDT 2017


Since MFString in text nodes is used to enable multiple lines in a text,
another idea would be use the newline/linefeed (and return) control
characters \n (and \r) as delimiters, perhaps just for such a
StringSequencer node:

keyValue=' "textA_line1 
 textA_line2" "textB_line1 
 textB_line2" '

the provided value_changed output would be a standard MFString : '
"textA_line1 " " textA_line2" '

This has the advantage that keyValue becomes a regular MFString. It has the
disadvantage of introducing a special case treatment of a MFString for a
potential StringSequencer node but that may be unavoidable.

I believe MFString is otherwise used mostly for URLs which should not have

 character.

Other than scripts, is there a way to provide sources of text content to
selectively use in a scene ? Switch only allows ChildNodes (Shapes and
Grouping nodes).

-Andreas


On Thu, Oct 5, 2017 at 11:39 AM, Andreas Plesch <andreasplesch at gmail.com>
wrote:

> While working on the IntegerSequencer test
>
> https://glitch.com/edit/#!/x3dom-sequencer-interval-test?
> path=IntegerKeyTest.html:54:10
>
> it was necessary to use a lot of switch nodes to display different texts
> depending on some input.
>
> With a StringSequencer one could directly feed text into Text nodes,
> selected by a key. This would substantially streamline scenes with dynamic
> or conditional text. Maybe String/TextSequencers/Interpolators had been
> discussed at some point ?
>
> Since such a StringSequencer would need to have multiple MFStrings as
> keyValues, a practical issue would become how to encode such an array of
> MFStrings in xml (and json). A MMFString in effect.
>
> Add another layer of quotes ?
> keyValue=" ' "MFString1_a" "MFString1_b" '  ' "MFString2_a" "MFString2_b"
> ' "
>
> Use comma as a dedicated delimiter ?
> keyValue=' "MFString1_a" "MFString1_b", "MFString2_a" "MFString2_b" '
>
> Some other delimiter (vertical bar |) ?
>
> -Andreas
>
> --
> Andreas Plesch
> Waltham, MA 02453
>



-- 
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171006/59889295/attachment.html>


More information about the x3d-public mailing list