Giter Club home page Giter Club logo

Comments (7)

bertt avatar bertt commented on June 20, 2024

Same for PropertyAttributesPropertyAttributePropertyMinMismatch.gltf

from 3d-tiles-validator.

javagl avatar javagl commented on June 20, 2024

I'll read a few things again to be 100% sure, but right now, I'm (only) 99% sure that this is a misunderstanding.

There are two different max values.

To put it that way:

  • the max of the attribute/texture property is the maximum value that actually appears
  • the max of the class property is the maximum value that is allowed to appear

This is reflected in the two test cases:

The names of these glTF files are quite a mouthful - but I tried to squeeze some meaning into that:

  • First one:
    • PropertyAttributes... - The category
    • ...PropertyAttributeProperty... - The specific thing that is wrong...
    • ...MaxMismatch - The actual error: A mismatch (meaning that they should match)
  • Second one:
    • PropertyAttributes... - The category
    • ...ClassProperty... - The specific thing that is wrong
    • ...MaxNotInRange - The actual error: The (computed) maximum is not in the (valid) range that was defined by the class.property.max

Also, the messages try to reflect that:

  • For the property attribute property: "For property 'intensity', the property defines a maximum of 0.3, but the computed maximum value is 0.25"
  • For the class property: "For property 'intensity', the class property defines a maximum of 0.7, but the value at 3 of the attribute _INTENSITY of primitive 2 of mesh 0 is 0.75"

If you think that this is a bug, then I'll have to look into that.
If you think that it is not a bug, but have ideas about how the validator or spec could be improved, feel free to drop them here.

(The inherent ambiguity of "maximum", with the specific meanings of "allowed maximum" and "appearing maximum", always bugged me, but that's on a rather linguistic level...)

from 3d-tiles-validator.

bertt avatar bertt commented on June 20, 2024

ah ok thanks, I see it now in the specs too:

property attribute property: Max: "Maximum value present in the property values. "

class property: Max: "Maximum allowed value for the property."

Indeed confusing to have a property with same name having complete different meanings in different parts of the specs... I thought only the latter definition was used. I'll check my code again.

from 3d-tiles-validator.

bertt avatar bertt commented on June 20, 2024

Btw: A property like max is 'Only applicable to SCALAR, VECN, and MATN types.' according to the specs. What if the type is Vector3, what could be the max value? How is it stored in the property, with comma separated values? Is there an example?

from 3d-tiles-validator.

javagl avatar javagl commented on June 20, 2024

Yeah, one could clarify this with elaborate names like maximumAllowedValue and maximumAppearingValue or so, but it's unlikely that such a change would/could still make it into the spec at this point.

What if the type is Vector3, what could be the max value? How is it stored in the property, with comma separated values? Is there an example?

I think that there currently is no dedicated example for that.

Eventually, the actual check boils down to a call to the ArrayValues class from the 3D Tiles Tools. This class could be seen as ... a bit awkward, because it tries to cover ~"values" that are structurally different: Scalars, 1D arrays, and 2D arrays. This is solely intended for the metadata handling, because there simply is no (TypeScript-level) type information about the metadata values. But it means that from the perspective of the validator, there is no difference for these cases: It just checks anyDeepGreaterThan(value, max) regardless of whether the value/max are number, number[], or number[][].

But it is indeed something for which it could be justified to add a dedicated test on the spec level. The ArrayValues class should have a decent test coverage. But on the validator side, it would be good to have such an example (even if it's a simple one).

About the structure of these values;

The values will always have the same structure as the metadata values. So when the property is a VEC3, then the JSON representation of the metadata value would be a 1D array [0.0, 1.0, 2.0]. When the value is an array of VEC2, then the JSON would be a 2D array [[0.0, 1.0], [2.0, 3.0]].

The actual operations (minimum/maximum, but also offset/scale) are always applied component-wise. This is mentioned at one point in the spec, and aligns with the accessor min/max properties of the glTF core specification.

from 3d-tiles-validator.

bertt avatar bertt commented on June 20, 2024

ah ok, and for a matrix it's 1D array column major or row major?

from 3d-tiles-validator.

bertt avatar bertt commented on June 20, 2024

Looks like column major https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#matrices

from 3d-tiles-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.