tween

Blitz3D Forums/Blitz3D Beginners Area/tween

Red(Posted 2004) [#1]
what does it mean ?

Is it usefull ?


puki(Posted 2004) [#2]
http://www.dscho.co.uk/blitz/tutorials/quaternions.shtml

Edit:
In addition, but not Blitz specific:
http://www.gamedev.net/reference/programming/features/vertextweening/


dmaz(Posted 2004) [#3]
[edit]forget my explanation, that gamedev.net article is very good[/edit]
It's very usefull. What it does is interpolates (inserts between) entity locations and changes. Basically you set your game elements to update at say 50fps (or whatever you want) but the actual rendering to the screen is done as fast(or slow) as the hardware can go.

The tween number that goes to RenderWorld is just a decimal usually between 0 and 1 that gets multiplyed to most of the entity commands like MoveEntity or TurnEntity. Here's an example...

Say we are using 50fps for updates but your computer is fast enough to render the graphics at 150 times per second. RenderWorld would be called 3 times before UpdateWorld is called again. The tween value then sent to RenderWorld is .33 (because 50 is 33% of 150) then .66 then 1. So if we have an entity at x,y and we move it to x+2 (in 1/50th of a second), it would actualy be drawn 3 times in that second. every drawn frame x=x+(2*.33)

What this does is allow the game to run at the same speed on all different types of hardware while still updating the screen as fast as possible. On faster computers the movement would be silky smooth.


puki(Posted 2004) [#4]
I believe, from memory, that "Mark SIbly" included it into a demo he wrote - not sure which one - but I have seen a Blitz3D demo utilising tweening.

Edit: by that I mean it was documented within the code.


Red(Posted 2004) [#5]
What this does is allow the game to run at the same speed on all different types of hardware

Very interesting


Ice9(Posted 2004) [#6]
What would be nice is the ability to tween from the middle
of one anim sequence to the first frame of another. It
would eliminate waiting for one sequence to end before
starting another such as run-jump flip (ouch hit) die.
rather than run-jump flip (ouch hit) I'll die when I finish
flipping.