[x3d-public] IFS example to fix.

Joseph D Williams joedwil at earthlink.net
Wed Jan 18 08:59:26 PST 2023


Hi John, 
This error set is telling you there is some user code somewhere(s) that does not have the right number of something(s) and the pattern(s) used repeatedly from the same DEF-USE or other maybe some simple copy and paste syntax. 
Is this from JohnJoint5.x3d? 
If Yes, these warnings show in view3dscene and don’t render some markers but are ok and seem to work in another. 
Some user code you might suspect. 

    <IndexedFaceSet DEF='DiamondIFS' creaseAngle='0.5' solid='false' 
     coordIndex='0 1 2 -1, 0 2 3 -1, 0 3 4 -1, 0 4 1 -1, 5 2 1 -1, 5 3 2 -1, 5 4 3 -1, 5 1 4 -1'>
     <ColorRGBA DEF='HAnimSiteColorRGBA' 
      color='1 1 0 1, 1 1 0 0.1'/>
     <Coordinate point='0 0.01 0, -0.01 0 0, 0 0 0.01, 0.01 0 0, 0 0 -0.01, 0 -0.01 0'/>
    </IndexedFaceSet>

Note IFS default colorPerVertex TRUE. So, tool might expect since 6 vertex, then 6 colors. 
Field colorPerVertex is TRUE by default. So if you have some number of points then you should have the same numbers of colors. RGBA uses special field SFColorRGBA 4-tuples, where each color value is an RGBA 4-tuple of floating point numbers in range [0,1]. Alpha (opacity) values = (1 - transparency). 
So, try:

      color='1 1 0 1, 1 1 0 0.1, 1 1 0 1, 1 1 0 0.1, 1 1 0 1, 1 1 0 0.1'/>

Forgiving browsers may give a clue and then go ahead and just keep using the last color for the remaining points. That is a feature you can use to search meshes to find points. Others may not work because they don’t do a kind of courtesy autofill that I especially like to see for some MF types. The downside is that forgiving browsers will give you something to at least look at so to see what happened.

So that gets rid of some hundred or so of these and the little boxes show as expected. Fixed what I might call spurious warnings with result of the bad things fail to render.

Now to see if that is what you really wanted to do; fix if necessary. 

Now onward to look for some 244 faulty warnings for some field of LineSet.  However, I can see from the rendering that some nice lines are rendered in spite of some 244 warnings about bad vertex count. At least I might be seeing  what the tool thinks is wrong. I hope this ends up to be a simple search and replace. More later. 

Side usability topic: Consistent use of Warnings. Where some may cause to not render node because child is bad and some may cause to render with Warning for bad field? 

Thanks, 
Joe

From: John Carlson
Sent: Wednesday, January 18, 2023 3:54 AM
To: X3D Graphics public mailing list
Subject: Re: [x3d-public] IFS example to fix.

Here is a small example that shows the potential issue, attached.

view3dscene reports errors, Schematron does not.  I will attempt JSON next.

John

On Wed, Jan 18, 2023 at 5:41 AM John Carlson <yottzumm at gmail.com> wrote:
This may interest people working with IFS in *some* HAnim examples, particularly mine!

JOhn
---------- Forwarded message ---------
From: John Carlson <yottzumm at gmail.com>
Date: Wed, Jan 18, 2023 at 5:22 AM
Subject: IFS example to fix.
To: Joe D Williams <joedwil at earthlink.net>

    <IndexedFaceSet DEF='DiamondIFS' creaseAngle='0.5' solid='false' coordIndex='0 1 2 -1 0 2 3 -1 0 3 4 -1 0 4 1 -1 5 2 1 -1 5 3 2 -1 5 4 3 -1 5 1 4 -1'>
     <ColorRGBA DEF='HAnimSiteColorRGBA' color='1 1 0 1 1 1 0 0.1'/>
     <Coordinate point='0 0.01 0 -0.01 0 0 0 0 0.01 0.01 0 0 0 0 -0.01 0 -0.01 0'/>
    </IndexedFaceSet>

The way I'm reading above, the IFS has 6 coordinates and 2 colors.  There should be more colors, correct?  view3dscene detected this.  I'll look up the IFS spec.

Thanks!

John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230118/753f839e/attachment.html>


More information about the x3d-public mailing list