#X3D V3.2 utf8 PROFILE Interchange # ---------------------------------------------------------------------------- # Testcase based on https://github.com/castle-engine/castle-model-viewer/issues/40 . # # - IndexedFaceSet # # - With non-trivial creaseAngle (vectors cannot be assumed perfectly flat or perfectly smooth) # # - Renderer should calculate as many normals as coordIndex (so 5 in this example, # the last one is actually useless -- normals for index -1 are generally useless, # but make it easier to address). # # This means *not* as many normals as Coordinate node # (it would be pointless, and also would not account for geometries where the same vertex # from Coordinate is addressed many times in coordIndex, and should have different # normal on each face). # # In CGE code terms, it means "niPerVertexNonIndexed", where "N := Normals.L[IndexNum]". # # - For renderer, this is a bit special case. # The IndexNum (used normally to access coordIndex) should be used to access Normals array. # This does not correspond to any "normal" X3D state, # when you provide "Normal" node explicitly in "normal" field, and # # - leave normalIndex empty. # # Then "niPerVertexCoordIndexed", "N := Normals.L[CoordIndex.Items.L[IndexNum]]". # # - set normalIndex. # # Then "niPerVertexNormalIndexed", "N := Normals.L[NormalIndex.ItemsSafe[IndexNum]]". # ---------------------------------------------------------------------------- # Generated by castle-model-viewer. # Use castle-model-viewer "Clipboard -> Print Current Camera..." to generate X3D code like below. # Camera settings "encoded" in the X3D declaration below : # position 4.21 -2.39 -1.26 # direction -0.84 0.48 0.25 # up -0.05 -0.53 0.85 # gravityUp 0.00 1.00 0.00 Viewpoint { position 4.2071061134338379 -2.3897814750671387 -1.2603694200515747 orientation 0.84581035375595093 0.23715686798095703 0.47787156701087952 2.2429020404815674 } Shape { appearance Appearance { material Material { } } geometry IndexedFaceSet { coord Coordinate { point [ -1 -1 -1, 1 -1 -1, -1 1 -1, 1 1 -1, -1 -1 1, 1 -1 1, -1 1 1, 1 1 1, ] } coordIndex [ 3, 7, 5, 1, -1, ] creaseAngle 0.5 } }