Need help with spatial geometry
#14

Show me the values basepos[]

@Edit

I also noticed you are attaching objects to object to object etc.. that means you need to rotate the point several times! Using the result as the next point of reference and translating the offsets to the next position rotation. It sounds complicated but it's very easy.

Код:
// List of attached objects to the base we need to calculate sequentially in
// order to figure out the position of the last attached object
static Float:CraneOffsets[6][6] = {
	{ 0.000000,0.000000,-0.009999,-0.469999,0.000000,90.000000 },// cabine to base
	{ 0.000000,-2.069998,8.448098,0.000000,0.000000,0.000000 },// crane-arm (i think) to cabine
	{ 0.000000,36.869819,-0.569999,0.000000,0.000000,0.000000 },// cable to arm
	{ 0.000000, 0.000000,-7.440086,0.000000,0.000000,0.000000 },// magnet to cable
	{ 0.000000, 0.000000,7.440086,0.000000,0.000000,0.000000 }// suplimentary cable for "effect go-down"
};


FindCraneOffset()
{
	// Get the position of the cranebase (unless it doesn't change you can set this)
	new Float:ret[6];
	GetDynamicObjectPos(ret[0], ret[1], ret[2]);
	GetDynamicObjectRot(ret[3], ret[4], ret[5]);

	// The first return reference is of course the base!
	for(new i = 0; i < 6; i++)
	{
		// Loop through each offset and rotation calculate real world position
		AttachPoint(CraneOffsets[i][0], CraneOffsets[i][1], CraneOffsets[i][2], CraneOffsets[i][3], CraneOffsets[i][4], CraneOffsets[i][5],
		ret[0], ret[1], ret[2], ret[3], ret[4], ret[5],
		ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
	}
	return 1;
}
Didn't test it but the idea is you start with the base it's position+rotation.
Now you need to calculate the real world position of the first object based on it's offsets and rotation.
Then the next based off the last...
etc...

Get it? Maybe? Sort of? You also might not have to do all the objects only up to where you need to but that is how it is done.
Reply


Messages In This Thread
Need help with spatial geometry - by Lunoxx - 04.02.2019, 01:28
Re: Need help with spatial geometry - by Kaliber - 04.02.2019, 08:25
Re: Need help with spatial geometry - by Lunoxx - 04.02.2019, 20:51
Re: Need help with spatial geometry - by MEGADETHS - 04.02.2019, 21:18
Re: Need help with spatial geometry - by IstuntmanI - 04.02.2019, 21:37
Re: Need help with spatial geometry - by Lunoxx - 04.02.2019, 22:05
Re: Need help with spatial geometry - by Pottus - 05.02.2019, 01:48
Re: Need help with spatial geometry - by Lunoxx - 05.02.2019, 14:00
Re: Need help with spatial geometry - by Pottus - 05.02.2019, 14:57
Re: Need help with spatial geometry - by Lunoxx - 05.02.2019, 16:08
Re: Need help with spatial geometry - by Lunoxx - 05.02.2019, 16:50
Re: Need help with spatial geometry - by Pottus - 05.02.2019, 19:04
Re: Need help with spatial geometry - by Lunoxx - 05.02.2019, 20:45
Re: Need help with spatial geometry - by Pottus - 05.02.2019, 21:26
Re: Need help with spatial geometry - by Lunoxx - 05.02.2019, 22:44
Re: Need help with spatial geometry - by Pottus - 05.02.2019, 22:48
Re: Need help with spatial geometry - by Lunoxx - 05.02.2019, 22:55
Re: Need help with spatial geometry - by Lunoxx - 06.02.2019, 16:13
Re: Need help with spatial geometry - by Lunoxx - 07.02.2019, 17:50
Re: Need help with spatial geometry - by Lunoxx - 09.02.2019, 21:35
Re: Need help with spatial geometry - by m4karow - 09.02.2019, 23:06
Re: Need help with spatial geometry - by Lunoxx - 09.02.2019, 23:38
Re: Need help with spatial geometry - by m4karow - 10.02.2019, 18:28
Re: Need help with spatial geometry - by Pottus - 10.02.2019, 20:31
Re: Need help with spatial geometry - by Lunoxx - 11.02.2019, 15:15
Re: Need help with spatial geometry - by Nero_3D - 12.02.2019, 00:45
Re: Need help with spatial geometry - by Pottus - 12.02.2019, 03:19
Re: Need help with spatial geometry - by Lunoxx - 13.02.2019, 06:02
Re: Need help with spatial geometry - by Nero_3D - 13.02.2019, 16:31
Re: Need help with spatial geometry - by Lunoxx - 13.02.2019, 22:55
Re: Need help with spatial geometry - by Nero_3D - 13.02.2019, 23:19
Re: Need help with spatial geometry - by Lunoxx - 14.02.2019, 08:24
Re: Need help with spatial geometry - by Lunoxx - 16.02.2019, 16:22
Re: Need help with spatial geometry - by Lunoxx - 19.02.2019, 07:20

Forum Jump:


Users browsing this thread: 1 Guest(s)