• Content count

  • Joined

  • Last visited

Community Reputation

119 Neutral

About zacharias

  • Rank
  1. [SOLVED] Dual Quaternion Issue

    Solved. Rotation centers should be implemented while creating the quats, not in the shader by offset. The weighting of offsets causes those artefacts.
  2. Hi guys! After several hours of debugging i decided to ask you for help ^^ I´ve implemented skeletal animation with dual quaternions in my engine, but it looks like something in the blending process is still wrong. this is how it should look, beautiful, isn´t it? [attachment=7379:1.jpg] and this is how it actually looks like in my engine. [attachment=7380:2.jpg] you can see the bones drawn as black lines, the squares indicate joints. detail, at a lower angle [attachment=7381:3.jpg] here is my vertexshader, calculating the blending. as you can see, i split up the dual quaternion in rotation- and translationpart. both are calculated in the engine. the bonePos is just the joint position. i checked the uniform values, everything is fine. [code]#version 120 // (C) Zacharias :-P attribute vec4 weights1; attribute vec4 gl_MultiTexCoord0; uniform vec3 bonePos[4]; uniform vec4 boneDQuatR[4]; uniform vec4 boneDQuatT[4]; vec3 calculateBlendPosition(vec3 position, vec4 blendDQR, vec4 blendDQT) { //blendDQR /= length(blendDQR); vec3 blendPosition = position + 2.0*cross(, cross(, position) + blendDQR.w*position); vec3 trans = 2.0*(blendDQR.w* - blendDQT.w* + cross(,; blendPosition += trans; return blendPosition; } void main(void) { // just pass the texture for now gl_TexCoord[0] = gl_MultiTexCoord0; // skinning vec4 v4 = gl_ModelViewMatrix * gl_Vertex; vec3 v =; // x y z w vec4 r = vec4(0.0,0.0,0.0,0.0); vec4 t = vec4(0.0,0.0,0.0,1.0); for(int i=0;i<4;i++) { v -= bonePos[i]*weights1[i]; r += boneDQuatR[i]*weights1[i]; t += boneDQuatT[i]*weights1[i]; } v = calculateBlendPosition(v, r, t); for(int i=0;i<4;i++) { v += bonePos[i]*weights1[i]; } gl_Position = gl_ProjectionMatrix * vec4(v, 1.0); }[/code] i tried out several things like normalizing etc, but everything seems to be fine. btw the blending gets better at the 2nd joint, but is still wrong. THX Zachy