Jump to content

  • Log In with Google      Sign In   
  • Create Account


Fixed Step - Interpolating positions, trafo hierarchies and snapping to position


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Icebone1000   Members   -  Reputation: 969

Like
0Likes
Like

Posted 11 December 2013 - 01:08 PM

Say you have a fixed step game loop, and youre interpolating positions just like that "Fix your time step" article.

 

Now say you have a transform hierarchy (world transforms that are computed from parent transforms and local transforms).

 

What I do Is interpolate previous world with current world (when current world != render world ). Works like a charm.

 

So I keep local, world and previous world, the render world is separated, with the render stuff.

 

What do I do if I want to snap to a position, with no interpolation? I cant set previous world by hand, because I only mess with the local transform (what if the parent change?)  I cant even think on what Id need to do to achieve that..Its confuse.

 

What should I do?



Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 11881

Like
3Likes
Like

Posted 11 December 2013 - 03:08 PM

Set the new position and then set the previous position to match it.  You say you can’t, but you can.

 

Although that is the correct way, if you still refuse to manipulate the previous position for whatever personal reason, add a flag to tell it not to interpolate and just use the current position until the flag is reset (which would be on the next logical update).

 

Parent transforms are unrelated to this problem.

 

 

L. Spiro


Edited by L. Spiro, 11 December 2013 - 03:09 PM.

It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 Icebone1000   Members   -  Reputation: 969

Like
0Likes
Like

Posted 11 December 2013 - 03:50 PM

I went to the flag, a bool...It works, but I dont have any parent for my current situation.

 

You say you can set by hand and parents are unrelated, but those are world transforms.. Theoretically you will have to compute all hierarchy by hand to be able to set the worlds so it do not conflict with the correct world that will be computed in the next logical step.

What if the world you set doesnt match the automatic computed world next step?

 

The intuitive thing would be to snap the local transform, but that doesnt make any sense for the rendering logic.


Edited by Icebone1000, 11 December 2013 - 03:52 PM.


#4 L. Spiro   Crossbones+   -  Reputation: 11881

Like
1Likes
Like

Posted 11 December 2013 - 05:46 PM

I don’t see how this is related to render interpolation.

If you want to set a world position on a child node then you have to set a local transform on the child that gets it into the correct world position based off the parent’s world position.

Which is simple:

Child.Local = AbsWorld * Inverse( Parent.World ).

 

With either a flag or setting the previous to the same as the current world transform the object will instantly be at the new position until the next logical update.

I don’t see the conflict here.  Interpolating for rendering is completely unrelated to the parent/child relationship/scene graph.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS