Comments (10)
Could you email me the model to use for debugging this? (see email on my github profile) I haven't managed to create a working IQM.
from spearmint.
I've confirmed that R_LerpTag for IQM returns the wrong information. It returns the "pose" for joint, instead of the joint information. Issue applies to ioquake3 as well.
from spearmint.
Great ! I was wondering if it was coming from the IQM exporter.
I'll try to do what I can to solve that. Thanks for the hint !
On Fri, Mar 8, 2013 at 5:23 AM, Zack Middleton [email protected]:
I've confirmed that R_LerpTag for IQM returns the wrong information. It
returns the "pose" for joint, instead of the joint information. Issue
applies to ioquake3 as well.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-14602128
.
from spearmint.
pose joint information is used to modify vertex positions for each frame,
the joint information is only included for unanimated position. I haven't
figured out how to get animated joint origin/axis at a frame. Hmm, what if
use joint matrix and multiply/add by pose matrix (like done for vertex
positions)? I'll try that later.
On Mar 8, 2013 7:39 AM, "Axel Isouard" [email protected] wrote:
Great ! I was wondering if it was coming from the IQM exporter.
I'll try to do what I can to solve that. Thanks for the hint !On Fri, Mar 8, 2013 at 5:23 AM, Zack Middleton [email protected]:
I've confirmed that R_LerpTag for IQM returns the wrong information. It
returns the "pose" for joint, instead of the joint information. Issue
applies to ioquake3 as well.—
Reply to this email directly or view it on GitHub<
https://github.com/zturtleman/spearmint/issues/11#issuecomment-14602128>
.—
Reply to this email directly or view it on GitHub.
from spearmint.
I'm working on it and maybe getting something, I've stored every joint matrices in memory, then doing this right after the end of the ComputeJointMats function (a copy of ComputePoseMats).
for( i = 0; i < data->num_joints; i++ ) {
float outmat[12];
mat1 = mat + 12 * i;
Matrix34Invert(mat1, outmat);
Matrix34Multiply( data->jointMats + 12 * (2 * i),
outmat, mat + 12 * i );
}
I'm getting this so far if I invert the pose matrice (the sword moves anormally in the Idle pose) : http://youtu.be/tcphImXf-VU
When I don't invert it, and multiply the joint matrice directly with the pose's : http://youtu.be/k2y2CZtzNJA
Do you have any idea ? I'm still trying some random stuff at the moment.
Here is my diff : http://pastebin.com/AC8LnRnx
from spearmint.
It seems to be more correct when I add the matrix instead of multiplying it.
The sword is perfectly stickied to the hand but still in the wrong direction. ( http://youtu.be/peOngNKValc )
static void Matrix34Add( float *a, float *b, float *out ) {
out[ 0] = a[ 0] + b[ 0];
out[ 1] = a[ 1] + b[ 1];
out[ 2] = a[ 2] + b[ 2];
out[ 3] = a[ 3] + b[ 3];
out[ 4] = a[ 4] + b[ 4];
out[ 5] = a[ 5] + b[ 5];
out[ 6] = a[ 6] + b[ 6];
out[ 7] = a[ 7] + b[ 7];
out[ 8] = a[ 8] + b[ 8];
out[ 9] = a[ 9] + b[ 9];
out[10] = a[10] + b[10];
out[11] = a[11] + b[11];
}
// inside the ComputeJointMats function
for( i = 0; i < data->num_joints; i++ )
Matrix34Add( data->jointMats + 12 * (2 * i), mat + 12 * i, mat + 12 * i );
from spearmint.
This seems to be working, after I finally realized my cgame code was making the axis wrong. Have swords in hands and with correct rotation.
static void Matrix34Multiply_OriginOnly( float *a, float *b, float *out ) {
out[ 3] = a[0] * b[3] + a[1] * b[7] + a[ 2] * b[11] + a[ 3];
out[ 7] = a[4] * b[3] + a[5] * b[7] + a[ 6] * b[11] + a[ 7];
out[11] = a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11];
}
static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
float backlerp, float *mat ) {
float *mat1;
int i;
ComputePoseMats( data, frame, oldframe, backlerp, mat );
for( i = 0; i < data->num_joints; i++ ) {
float outmat[12];
mat1 = mat + 12 * i;
Com_Memcpy(outmat, mat1, sizeof(outmat));
Matrix34Multiply_OriginOnly( outmat, data->jointMats + 12 * 2 * i, mat1 );
}
}
Going to clean it up soon.
from spearmint.
ioq3 commit: ioquake/ioq3@8aa6efe
It's merged into Spearmint as well.
Let me know if it's works for you or not.
from spearmint.
Awesome !
I should rotate the sword correctly and it will be perfect.
Thanks a lot !
from spearmint.
Just to clarify, my issue with rotation was that I was placing sword on legs model twice (so it rotated double and would spin when player model rotated).
something like
CG_PositionRotatedEntityOnTag( &torso, &legs, legs.hModel, "Waist");
//disabled rendering torso
...
torso.hModel = swordModel;
CG_PositionRotatedEntityOnTag( &torso, &legs, legs.hModel, "Handle.R");
//render sword
I figured it out when I added second sword, which spun twice as fast as the first while turning. Doing AxisClear ( torso.axis );
before CG_PositionRotatedEntityOnTag
solved the issue.
from spearmint.
Related Issues (20)
- AAS_PlayerMovementPrediction() doesn't handle friction correctly HOT 2
- Request: can you add the support to quake 3 cinematic texture HOT 10
- Misleading comment that networked entityState_t weapon bits must be at least 8
- q3map2 "_skybox" entity rendering is broken HOT 1
- Support for Star Trek Elite Force 2 Demo BSPs HOT 1
- Rendering issue in stchdm2 (The State is Not Your Friend), HOT 5
- Rendering Issue Rustgrad HOT 6
- Can't load prerendered font correctly HOT 1
- Team Arena won't play in 1080p HOT 2
- Add support for FAKK/Alice SKB models / SKA animations
- Add support for shader keywords in Q3 IHV and Q3Test 1.03/1.05
- Add a workaround for MAX_PATCH_PLANES HOT 4
- cg_thirdPerson 1 draws crosshair sprite in mirrors
- timescale causes choppiness HOT 2
- S_StopAllSounds() doesn't stop all streaming sounds
- Add com_maxfps to Graphics Settings HOT 1
- OpenGL1: Overbright without gamma ramps
- Spearmint and OBS HOT 1
- OpenGL2: minor fix for Splitscreen view. HOT 1
- Add cvar for zoom sensitivity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spearmint.