Tangent Interpolation











up vote
0
down vote

favorite












I am currently working on an Colladae(.dae) loader for LWJGL which loads full scene information in one class. One of the elements I find it hard to decode is animation.



So basically I want my animator to support any type of animation. Right now it supports Matrix interpolation i.e I extract my translation,rotation,scale values from my matrices and interpolate's them.



The one animation I don't know how to implement is tangent animation. For example
One of samplers has this following structure



<sampler id="Cube_location_X-sampler">
<input semantic="INPUT" source="#Cube_location_X-input"/>
<input semantic="OUTPUT" source="#Cube_location_X-output"/>
<input semantic="INTERPOLATION" source="#Cube_location_X-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_location_X-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_location_X-outtangent"/>
</sampler>
<channel source="#Cube_location_X-sampler" target="Cube/location.X"/>


So The
"INPUT" is nothing but my animation timings(0 to 1)
"OUTPUT" is nothing but my xlocations at every key frame
"INTERPOLATION" for me is always Linear so I don't read that data



"IN_TANGENT" And "OUT_TANGENT" is what I have no idea on what to do with them



When the data is viewed



This is how the "IN_TANGENT" Data looks like



<source id="Cube_location_X-intangent">
<float_array id="Cube_location_X-intangent-array" count="2">0 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-intangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


And this is how the "OUT_TANGENT" Data looks like



<source id="Cube_location_X-outtangent">
<float_array id="Cube_location_X-outtangent-array" count="2">0.08333331 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-outtangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


Right now both my Tangent data is 2D because I was just moving my cube in one plane in blender but I assume it can be 3D as well(Or maybe not?)



I feel I could use this data for smoother animation but I don't know the mathematics or algorithm to in co-operate this data in my Animator



The Tangents are also available for my rotation as well but again I don't know what to do with them



Eg:



<sampler id="Cube_rotation_euler_Z-sampler">
<input semantic="INPUT" source="#Cube_rotation_euler_Z-input"/>
<input semantic="OUTPUT" source="#Cube_rotation_euler_Z-output"/>
<input semantic="INTERPOLATION" source="#Cube_rotation_euler_Z-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_rotation_euler_Z-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_rotation_euler_Z-outtangent"/>
</sampler>


If not Code an bit of mathematics or ideas on what do with these values would be very usefull.
Thank U










share|improve this question






















  • You do know that LWJGL 3 comes with Assimp, which handles loading of many file formats, including COLLADA?
    – httpdigest
    Nov 7 at 21:03










  • True but u see I built an specific framework around my project and am basically building things from bottom up.Im trying to figure out stuff my self
    – R VISHAL
    Nov 8 at 3:49

















up vote
0
down vote

favorite












I am currently working on an Colladae(.dae) loader for LWJGL which loads full scene information in one class. One of the elements I find it hard to decode is animation.



So basically I want my animator to support any type of animation. Right now it supports Matrix interpolation i.e I extract my translation,rotation,scale values from my matrices and interpolate's them.



The one animation I don't know how to implement is tangent animation. For example
One of samplers has this following structure



<sampler id="Cube_location_X-sampler">
<input semantic="INPUT" source="#Cube_location_X-input"/>
<input semantic="OUTPUT" source="#Cube_location_X-output"/>
<input semantic="INTERPOLATION" source="#Cube_location_X-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_location_X-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_location_X-outtangent"/>
</sampler>
<channel source="#Cube_location_X-sampler" target="Cube/location.X"/>


So The
"INPUT" is nothing but my animation timings(0 to 1)
"OUTPUT" is nothing but my xlocations at every key frame
"INTERPOLATION" for me is always Linear so I don't read that data



"IN_TANGENT" And "OUT_TANGENT" is what I have no idea on what to do with them



When the data is viewed



This is how the "IN_TANGENT" Data looks like



<source id="Cube_location_X-intangent">
<float_array id="Cube_location_X-intangent-array" count="2">0 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-intangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


And this is how the "OUT_TANGENT" Data looks like



<source id="Cube_location_X-outtangent">
<float_array id="Cube_location_X-outtangent-array" count="2">0.08333331 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-outtangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


Right now both my Tangent data is 2D because I was just moving my cube in one plane in blender but I assume it can be 3D as well(Or maybe not?)



I feel I could use this data for smoother animation but I don't know the mathematics or algorithm to in co-operate this data in my Animator



The Tangents are also available for my rotation as well but again I don't know what to do with them



Eg:



<sampler id="Cube_rotation_euler_Z-sampler">
<input semantic="INPUT" source="#Cube_rotation_euler_Z-input"/>
<input semantic="OUTPUT" source="#Cube_rotation_euler_Z-output"/>
<input semantic="INTERPOLATION" source="#Cube_rotation_euler_Z-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_rotation_euler_Z-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_rotation_euler_Z-outtangent"/>
</sampler>


If not Code an bit of mathematics or ideas on what do with these values would be very usefull.
Thank U










share|improve this question






















  • You do know that LWJGL 3 comes with Assimp, which handles loading of many file formats, including COLLADA?
    – httpdigest
    Nov 7 at 21:03










  • True but u see I built an specific framework around my project and am basically building things from bottom up.Im trying to figure out stuff my self
    – R VISHAL
    Nov 8 at 3:49















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am currently working on an Colladae(.dae) loader for LWJGL which loads full scene information in one class. One of the elements I find it hard to decode is animation.



So basically I want my animator to support any type of animation. Right now it supports Matrix interpolation i.e I extract my translation,rotation,scale values from my matrices and interpolate's them.



The one animation I don't know how to implement is tangent animation. For example
One of samplers has this following structure



<sampler id="Cube_location_X-sampler">
<input semantic="INPUT" source="#Cube_location_X-input"/>
<input semantic="OUTPUT" source="#Cube_location_X-output"/>
<input semantic="INTERPOLATION" source="#Cube_location_X-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_location_X-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_location_X-outtangent"/>
</sampler>
<channel source="#Cube_location_X-sampler" target="Cube/location.X"/>


So The
"INPUT" is nothing but my animation timings(0 to 1)
"OUTPUT" is nothing but my xlocations at every key frame
"INTERPOLATION" for me is always Linear so I don't read that data



"IN_TANGENT" And "OUT_TANGENT" is what I have no idea on what to do with them



When the data is viewed



This is how the "IN_TANGENT" Data looks like



<source id="Cube_location_X-intangent">
<float_array id="Cube_location_X-intangent-array" count="2">0 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-intangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


And this is how the "OUT_TANGENT" Data looks like



<source id="Cube_location_X-outtangent">
<float_array id="Cube_location_X-outtangent-array" count="2">0.08333331 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-outtangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


Right now both my Tangent data is 2D because I was just moving my cube in one plane in blender but I assume it can be 3D as well(Or maybe not?)



I feel I could use this data for smoother animation but I don't know the mathematics or algorithm to in co-operate this data in my Animator



The Tangents are also available for my rotation as well but again I don't know what to do with them



Eg:



<sampler id="Cube_rotation_euler_Z-sampler">
<input semantic="INPUT" source="#Cube_rotation_euler_Z-input"/>
<input semantic="OUTPUT" source="#Cube_rotation_euler_Z-output"/>
<input semantic="INTERPOLATION" source="#Cube_rotation_euler_Z-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_rotation_euler_Z-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_rotation_euler_Z-outtangent"/>
</sampler>


If not Code an bit of mathematics or ideas on what do with these values would be very usefull.
Thank U










share|improve this question













I am currently working on an Colladae(.dae) loader for LWJGL which loads full scene information in one class. One of the elements I find it hard to decode is animation.



So basically I want my animator to support any type of animation. Right now it supports Matrix interpolation i.e I extract my translation,rotation,scale values from my matrices and interpolate's them.



The one animation I don't know how to implement is tangent animation. For example
One of samplers has this following structure



<sampler id="Cube_location_X-sampler">
<input semantic="INPUT" source="#Cube_location_X-input"/>
<input semantic="OUTPUT" source="#Cube_location_X-output"/>
<input semantic="INTERPOLATION" source="#Cube_location_X-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_location_X-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_location_X-outtangent"/>
</sampler>
<channel source="#Cube_location_X-sampler" target="Cube/location.X"/>


So The
"INPUT" is nothing but my animation timings(0 to 1)
"OUTPUT" is nothing but my xlocations at every key frame
"INTERPOLATION" for me is always Linear so I don't read that data



"IN_TANGENT" And "OUT_TANGENT" is what I have no idea on what to do with them



When the data is viewed



This is how the "IN_TANGENT" Data looks like



<source id="Cube_location_X-intangent">
<float_array id="Cube_location_X-intangent-array" count="2">0 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-intangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


And this is how the "OUT_TANGENT" Data looks like



<source id="Cube_location_X-outtangent">
<float_array id="Cube_location_X-outtangent-array" count="2">0.08333331 -1.061734</float_array>
<technique_common>
<accessor source="#Cube_location_X-outtangent-array" count="1" stride="2">
<param name="X" type="float"/>
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>


Right now both my Tangent data is 2D because I was just moving my cube in one plane in blender but I assume it can be 3D as well(Or maybe not?)



I feel I could use this data for smoother animation but I don't know the mathematics or algorithm to in co-operate this data in my Animator



The Tangents are also available for my rotation as well but again I don't know what to do with them



Eg:



<sampler id="Cube_rotation_euler_Z-sampler">
<input semantic="INPUT" source="#Cube_rotation_euler_Z-input"/>
<input semantic="OUTPUT" source="#Cube_rotation_euler_Z-output"/>
<input semantic="INTERPOLATION" source="#Cube_rotation_euler_Z-interpolation"/>
<input semantic="IN_TANGENT" source="#Cube_rotation_euler_Z-intangent"/>
<input semantic="OUT_TANGENT" source="#Cube_rotation_euler_Z-outtangent"/>
</sampler>


If not Code an bit of mathematics or ideas on what do with these values would be very usefull.
Thank U







lwjgl






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 7 at 12:50









R VISHAL

297




297












  • You do know that LWJGL 3 comes with Assimp, which handles loading of many file formats, including COLLADA?
    – httpdigest
    Nov 7 at 21:03










  • True but u see I built an specific framework around my project and am basically building things from bottom up.Im trying to figure out stuff my self
    – R VISHAL
    Nov 8 at 3:49




















  • You do know that LWJGL 3 comes with Assimp, which handles loading of many file formats, including COLLADA?
    – httpdigest
    Nov 7 at 21:03










  • True but u see I built an specific framework around my project and am basically building things from bottom up.Im trying to figure out stuff my self
    – R VISHAL
    Nov 8 at 3:49


















You do know that LWJGL 3 comes with Assimp, which handles loading of many file formats, including COLLADA?
– httpdigest
Nov 7 at 21:03




You do know that LWJGL 3 comes with Assimp, which handles loading of many file formats, including COLLADA?
– httpdigest
Nov 7 at 21:03












True but u see I built an specific framework around my project and am basically building things from bottom up.Im trying to figure out stuff my self
– R VISHAL
Nov 8 at 3:49






True but u see I built an specific framework around my project and am basically building things from bottom up.Im trying to figure out stuff my self
– R VISHAL
Nov 8 at 3:49



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189799%2ftangent-interpolation%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189799%2ftangent-interpolation%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini