Closed myaaaaaaaaa closed 1 year ago
At a cursory glance, this would remove some redundancies in specifying Index/Position/Color/etc multiple times.
modeler.Read*()
primitive := doc.Meshes[0].Primitives[0] -position, err := modeler.ReadPosition(doc, doc.Accessors[primitive.Attributes[gltf.POSITION]], nil) +position, err := modeler.ReadPosition(doc, primitive, nil) -color, err := modeler.ReadColor(doc, doc.Accessors[primitive.Attributes[gltf.COLOR_0]], nil) +color, err := modeler.ReadColor(doc, primitive, 0, nil)
modeler.Write*()
primitive := &gltf.Primitive{} doc.Meshes = []*gltf.Mesh{{ Name: "Pyramid", Primitives: []*gltf.Primitive{primitive}, }} -primitive.Indices = gltf.Index(modeler.WriteIndices(doc, indices)) +modeler.WriteIndices(doc, primitive, indices) -primitive.Attributes[gltf.POSITION] = modeler.WritePosition(doc, position) +modeler.WritePosition(doc, primitive, position) -primitive.Attributes[gltf.COLOR_0] = modeler.WriteColor(doc, color) +modeler.WriteColor(doc, primitive, 0, color)
Closing in favor of #72 , sorry for the noise
At a cursory glance, this would remove some redundancies in specifying Index/Position/Color/etc multiple times.
modeler.Read*()
modeler.Write*()