Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

I am making an attempt to make a skeleton animation utilizing Rust, OpenGL (particularly the gl library), loading gltf information. I loaded the interpretation and rotation data into two variables inside the vertex shader that are ANIMACAO2 and ANIMACAO3…

uniform vec3 ANIMACAO2[65]; // translate
uniform vec4 ANIMACAO3[65]; // rotate

I researched and noticed on the web that it rotates with quaternion like this:

vec3 Girar(vec3 u, vec4 q){
    return 2*dot(q.xyz, u) * q.xyz + (q.w*q.w - dot(q.xyz,q.xyz)) * u + 2 * q.w * cross(q.xyz,u);
}

After which I attempted to use the transformations to the mannequin like this:

float ant = 0;
for(int i = 0; i < 4; i++){
    if(ossosid[i] > ant){
        ant = ossosid[i];
    }else{
        break;
    }
    pos-=ANIMACAO2[int(ossosid[i])];
    vec4 angulo = ANIMACAO3[int(ossosid[i])];
    angulo = vec4(angulo.x,angulo.y,angulo.z,angulo.w);
    pos = Girar(pos, angulo*pesos[i]);
    pos+=ANIMACAO2[int(ossosid[i])];
}

I am making an attempt to calculate the animation primarily based on what I perceive, however I’ve already tried 12 to 14 variations of the code and I nonetheless have not discovered one which works, though each time it looks like I am very near getting it proper. The place is the error within the calculation?

I am testing on fashions:

EXEMPLO.gltf and ANDAR.gltf

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *