Code Monkey home page Code Monkey logo

Comments (5)

LxLasso avatar LxLasso commented on May 29, 2024

I would open the glTF file in a text editor and step through the code in a debugger until I discover what is not happening as I had expected. Are there triangles in the glTF? 16-bit indexed? Has the buffer been loaded?

from cgltf.

zeux avatar zeux commented on May 29, 2024
                    const float* position_data = (float *)position_accessor->buffer_view->buffer->data;

This ignores any type of offset that might apply to the accessor. I would recommend using cgltf_accessor_read_float or cgltf_accessor_unpack_floats helpers to read any attribute data.

                    if (index_accessor->component_type == cgltf_component_type_r_16u)

Note that you don't actually need this if you use cgltf_accessor_read_index since that function will handle different types transparently.

from cgltf.

jkuhlmann avatar jkuhlmann commented on May 29, 2024

@sancelot Did the comments here help?

from cgltf.

sancelot avatar sancelot commented on May 29, 2024

I was trying To decode the blender cube at first before a bigger file ..I have not had time to continue. I will retry it very soon. I want to load the file in ordre To display it and have thΓ© scenegraph available.

from cgltf.

 avatar commented on May 29, 2024

@jkuhlmann could the code above maybe get worked into an example? with incorporated use of cgltf_accessor_read_index as you mentioned

from cgltf.

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.