3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: delay with iObjectLocation - iObjectLocationSet  (Read 1409 times)

« on: September 26, 2009, 10:25:57 PM »
ok, so Im trying to glue and object to another using  iObjectLocation -  iObjectLocationSet

I find the location of object A with  iObjectLocation and put the object B near to A using iObjectLocationSet.
So in theory everything is beatiful, but the problem is that the faster object A moves the far from it object B is located. like it has some delay, I really find so dificult to understand "why" that it actually compromise my ability to explain it... so there's an example attached.

You could say, "why dont you just link 'em?"... well, aside that isnt the point, I cant link em because I want the location only, not the orientation, and if I link the objects then object B will change its orientation too and everything is ruined. so dont say it.


SO, my questions would be:

why this happens?
i really dont understand it since the script is suppose to be executed at least the same number of times that frames are displayed.

is a way around to solve this issue?
(other than use speed to calculate how much ahead I should locate B ^^, please...)

if not, should there be some hope that this problem gonna be fixed?
« Last Edit: September 26, 2009, 10:36:35 PM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #1 on: September 27, 2009, 02:20:54 PM »
The delay happens because 3D Rad objects communicate through messages. The messaging system is highly optimized but sometimes between a message like 'what is your position?' and 'my position is XYZ' the object in question may have been updated.

The typical workaround is recording the previous position along with the current and calculate the 'next' position based on that, before applying it to the destination object (for example the SkinMesh to attach to a RigidBody.

« Reply #2 on: September 27, 2009, 02:32:57 PM »
The typical workaround is recording the previous position along with the current and calculate the 'next' position based on that, before applying it to the destination object (for example the SkinMesh to attach to a RigidBody.

ok, im totally lost now.

could you provide and example that makes things work like you said, for an example like mine?

I mean, I want to move togheter 2 objects that are not linked (like the skinmesh-rigedbody example you mention, which just happen are linked).

--------------
also, what really worries me is this:
lets suppose I want to make a big space ship that use a lot of repeated parts, that I conveniently intend to use imposters for them. with this delay it just cannot be done. so, how can I move these imposters without delay (and without link 'em, which ofcourse is impossible).
« Last Edit: September 27, 2009, 02:35:16 PM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!

psikotropico

« Reply #3 on: September 27, 2009, 11:23:32 PM »
you can use joints
« Reply #4 on: September 28, 2009, 12:29:18 AM »
well, yeah, I can use joints... but this is what I want to do:

object A is this face ->  :-\
object B is this face ->   :-[

I want B x+1 at the side of A, so, when A is pointing "north" B is at its side like this:
 :-\ :-[

and when A is pointing "south", I want B x+1 at the side of A, which just happens to be the same side!
 :-\ :-[

I think you cant do that with joins.

besides you know what, I dont want 1001 joints hanging around in the object list  :)

--------------------------
plus, you canT use joints with imposters can you?

--------------------------------
PLUS... joints only works with objects that supports physics...
so, definitly I canT use joints.

---------
----------
I think I'll better wait for a working example of the workaround, if there's any
« Last Edit: September 28, 2009, 01:16:27 AM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #5 on: September 28, 2009, 02:50:35 AM »
In your example, if you use a Skinmesh or Imposter in place of the Ball, there is no problem at all.......the YellowFish sticks firmly to the moving Car at the location specified. It is just with the Ball where the "delay"  is experienced. The Ball is physics-based, so this probably has something to do with it?

QED
« Last Edit: September 28, 2009, 03:03:47 AM by AllanF »
AKA: The 3D Raddict http://www.3draddict.com/
« Reply #6 on: September 28, 2009, 11:56:52 AM »
mmm no, I first experimented the problem with the trails, so no, it dosnt happens only with physics-based objects. I'll give a try with the fish and imposters...
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #7 on: September 28, 2009, 12:03:23 PM »
I've had some problems with particles at high speed and used this workaround for the y-vector

http://www.3drad.com/forum/index.php?topic=2053.msg15205#msg15205

basicly you correct with an offset
(object speed in kmh)/72

I have no idea if you can use this on other objects than particles.
« Reply #8 on: September 28, 2009, 12:20:08 PM »
oook, it works fine with the fish or another skinmesh. that's good.

shadmar, thank you, I considered that at first, problem is I was using this for a car, so besides use the offset I should change the orientation too using iVectorRotate, like in this example here http://www.3drad.com/forum/index.php?topic=2525.0

so I think I'd go with an invisible skinmesh a link things to it.  ::)
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
Pages: [1]