Shaking axes when animating

I have the code below to animate a point. During the animation, the axes are shaking. I have added PlotRange, and PlotRangePadding -> None. Still shaking. If I export the animation to a gif, the Axes will stop shaking. Can anyone help?

  Graphics[    {     PointSize[0.02],     Point[{Cos[t], Cos[t]}]     },    PlotRange -> {{-2, 2}, {-2, 2}},    Axes -> True    ],   PlotRange -> {{-2, 2}, {-2, 2}},   PlotRangePadding -> None   ], {t, 0, 10, 0.1}]``` 

Vertex skinning, calculating the bone matrices (for bind pose) and then animating them

I am attempting to do HW skinning in Opengl. Please note that I am purposefully doing it in a not-game ready optimized way, because I need this to scale. I wrote the following code to ‘apply’ the skinning:

  mat4 BoneXForm;    for (int i = 0; i < maximumInfluence; i++) {     BoneXForm += globalAnimMats[blendWeights[i * gl_VertexID].blendId] * blendWeights[i * gl_VertexID].blendValue;   }    vec4 VertPoseLong = BoneXForm * vec4(vertPos, 1.0);    // Set the vertex postion   gl_Position = MVP * VertPoseLong; 

This code uses ‘globalAnimMats’ a mat4 x bones, and an array of skinning indices/value combos:

struct { int BoneIndex; float Influence; }; 

My issue is, I am not sure what the value of each matrix should be in the matrix buffer. Per each bone on the CPU, I have local space pos/rot and global space pos/rot. My goal here is so also apply an animation to the skeleton.

The position is a vec3 and the rotation is a quat. I have tried doing global pos/rot as a mat4 but the whole model moves above the skeleton.

What is a creature’s “animating spirit”?

The spell speak with dead says:

You grant the semblance of life and intelligence to a corpse of your choice within range, allowing it to answer the questions you pose. […]

[…] The corpse knows only what it knew in life, including the languages it knew. Answers are usually brief, cryptic, or repetitive, and the corpse is under no compulsion to offer a truthful answer if you are hostile to it or it recognizes you as an enemy. This spell doesn’t return the creature’s soul to its body, only its animating spirit. Thus, the corpse can’t learn new information, doesn’t comprehend anything that has happened since it died, and can’t speculate about future events.

What is an “animating spirit” in this context? In what way is it different to a soul? Specifically, is an “animated spirit” established in published lore anywhere? I’d prefer sources from D&D 5e, but lore from previous editions is welcome as well. Also, if “published lore” isn’t specific enough, assume Forgotten Realms.

OpenGL Strange mesh when animating Assimp

I’m trying to animate a skeletal mesh. The mesh loads with no problems and all is set up correctly. My problem is that when I calculate the matrix for a given keyframe the mesh go nuts.

Here is na image of the problem.

enter image description here

The mesh on the right is using the bonĂ© transform as the final matrix. the ne one the left is using the matrix calculated from keyframes. I don’t know where i’m going wrong with this.

Here is my code:

The Animation Clip where all keyframes are stored:

Matrix4 AnimationClip::GetTransform(Bone *bone, float deltaTime) { Channel* channel = channels[bone->name]; if (channel == nullptr)     return bone->transform; else     return channel->Update(deltaTime); }  ///////////  Channel::Channel(aiNodeAnim* animNode) { name = string(animNode->;  for (GLuint k = 0; k < animNode->mNumPositionKeys; k++) {     aiVectorKey vec = animNode->mPositionKeys[k];     positions.push_back(         Keyframe<Vector3>(         (float)vec.mTime,             Vector3(vec.mValue.x, vec.mValue.y, vec.mValue.z))); }  for (GLuint k = 0; k < animNode->mNumScalingKeys; k++) {     aiVectorKey vec = animNode->mScalingKeys[k];     scalings.push_back(         Keyframe<Vector3>(         (float)vec.mTime,             Vector3(vec.mValue.x, vec.mValue.y, vec.mValue.z))); }  for (GLuint k = 0; k < animNode->mNumRotationKeys; k++) {     aiQuatKey vec = animNode->mRotationKeys[k];     rotations.push_back(         Keyframe<Quaternion>(         (float)vec.mTime,             Quaternion(                 vec.mValue.x,                 vec.mValue.y,                 vec.mValue.z,                 vec.mValue.w))); } }  Matrix4 Channel::Update(float animTime) { return     CalculatePosition(animTime) *     CalculateRotation(animTime) *     CalculateScaling(animTime); }  Matrix4 Channel::CalculatePosition(float animationTime) { return      Matrix4::CreateTranslation(         CalcInterpolatedPosition(animationTime)); }  Vector3 Channel::CalcInterpolatedPosition(float animationTime) { if (positions.size() == 1)     return positions[0].value;  GLuint positionIndex = FindPosition(animationTime); GLuint nextPositionIndex = (positionIndex + 1);  float deltaTime =      positions[nextPositionIndex].time - positions[positionIndex].time; float factor =      (animationTime - (float)positions[positionIndex].time) / deltaTime;  Vector3 startPos = positions[positionIndex].value; Vector3 endPos = positions[nextPositionIndex].value;  Vector3 delta = endPos - startPos;  return startPos + delta * factor;//Vector3::Lerp(startPos, endPos, factor); }  GLuint Channel::FindPosition(float AnimationTime) { for (GLuint i = 0; i < positions.size() - 1; i++) {     if (AnimationTime < (float)positions[i + 1].time)         return i; } return 0; } 

And Here is my Skinned Mesh code where I’m fetching the keyframes:

void SkinnedMesh::BoneTransform( double delta,  vector<Matrix4>& transforms, AnimationClip *anim) { Matrix4 identity_matrix = Matrix4::Identity();  float ticksPerSecond =      anim->ticksPerSecond == 0 ? 25.0f : anim->ticksPerSecond;  double time_in_ticks = delta * ticksPerSecond; float animation_time =      fmod((float)time_in_ticks, anim->duration);  UpdateTransforms(     animation_time,      anim,      rootBone,     identity_matrix);  transforms.resize(m_num_bones);  for (GLuint i = 0; i < m_num_bones; i++)     transforms[i] =          m_bone_matrices[i].final_world_transform; }  void SkinnedMesh::UpdateTransforms( float p_animation_time, AnimationClip *anim, Bone *parentBone, Matrix4& parentTransform) { Matrix4 boneTransform =// parentBone->transform;     anim->GetTransform(parentBone, p_animation_time);  Matrix4 global_transform =     parentTransform * boneTransform;  if (m_bone_mapping.find(parentBone->name) !=     m_bone_mapping.end()) // true if node_name exist in bone_mapping {     GLuint bone_index = m_bone_mapping[parentBone->name];     m_bone_matrices[bone_index].final_world_transform =         m_global_inverse_transform *         global_transform *          m_bone_matrices[bone_index].offset_matrix; }  for (vector<Bone*>::iterator it =     parentBone->children.begin();     it != parentBone->children.end();      it++) {     UpdateTransforms(         p_animation_time,         anim,         (*it),          global_transform); } }  void SkinnedMesh::Render(Shader* shader, AnimationClip *clip) { vector<Matrix4> transforms; BoneTransform(     (double)SDL_GetTicks() / 1000.0f,     transforms,     clip);  for (GLuint i = 0; i < transforms.size(); i++) {     GLfloat values[16];     Matrix4::ValuePointer(transforms[i], values);      string a = "jointTransforms[";     a.append(to_string(i));     a.append("]");      glProgramUniformMatrix4fv(         shader->GetID(),         shader->GetUniformLocation(a.c_str()),         1,         GL_FALSE,          (const GLfloat*)values); }  for (unsigned int i = 0; i < meshes.size(); i++)     meshes[i]->Render(shader); } 

It seems the matrices are all wrong and therefore deforming the mesh. Can you help me?


The Meh on the right has this code :

Matrix4 AnimationClip::GetTransform(Bone *bone, float deltaTime) { Channel* channel = channels[bone->name]; if (channel == nullptr) return bone->transform; else return bone->transform; 


How long should I wait before animating the navigation bar in/out when the user scrolls?

I’m currently working on a new design for a site and I’ve encountered a problem I’ve never found before.

I want to collapse the navigation bar up when the user scrolls down to increase available real estate.

Is there a standard time delay to wait before collapsing a menu?

MORPH TARGET INFLUENCES continuously keeps giving me UNDEFINED when animating object in three.js

So I exported this simple 2d animation (circle that morphs into a triangle) as a gltf file into my three.js project. But when i run it, I get this error: “Uncaught TypeError: Cannot set property ‘0’ of undefined at render“. This error come this line of code: “mesh.morphTargetInfluences[ 0 ] = Math.sin(delta) * 20.0;

By looking at my code, i made sure my scene is my mesh. I also log the mesh geometry to see that is not undefined. I get no errors when i set my Morph Targets to TRUE either. But When i do console(console.log(mesh.morphTargetInfluences) i do get UNDEFINED which i don’t know why since all the mesh geometry is there.

<html> <head>     <title>threejs - models</title>     <style>         body{             margin: 0;             overflow: hidden;         }     </style> </head> <body> <canvas id="myCanvas"></canvas>  <script src="js/three.js"></script> <script src="js/GLTFLoader.js"></script>  <script>  var renderer,     scene,     camera,     myCanvas = document.getElementById('myCanvas'); var mesh;   //RENDERER renderer = new THREE.WebGLRenderer({   canvas: myCanvas,    antialias: true }); renderer.setClearColor(0xffffff); renderer.setPixelRatio(window.devicePixelRatio); renderer.setSize(window.innerWidth, window.innerHeight);  //CAMERA camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 0.1, 1000 );  //SCENE scene = new THREE.Scene();  //LIGHTS var light = new THREE.AmbientLight(0xffffff, 0.5); scene.add(light);  var light2 = new THREE.PointLight(0xffffff, 0.5); scene.add(light2);  var loader = new THREE.GLTFLoader();  loader.load('morphObj.gltf', function ( gltf ) {          gltf.scene.traverse( function ( node ) {              if ( node.isMesh ) {                 mesh = node;                 mesh.material.morphTargets = true;               console.log(mesh.geometry);         }          } );          //mesh.material.morphTargets = true;         console.log(mesh.morphTargetInfluences);          //console.log(mesh.material.morphTargets);      //mesh.material = new THREE.MeshLambertMaterial();     scene.add( mesh );     mesh.position.z = -10; });    //RENDER LOOP render();  var delta = 0; var prevTime =;  function render() {      delta += 0.1;      if ( mesh !== undefined ) {         console.log("mesh is not undefined!");           mesh.rotation.y += 0.01;          //animation mesh          mesh.morphTargetInfluences[ 0 ] = Math.sin(delta) * 20.0;     }      renderer.render(scene, camera);      requestAnimationFrame(render); }      </script>> </body> </html> 

I’m very new to three.js so fusure I’m forgetting something in my program, but i don’t know what that is. I will really appreciate your help guys