Going through hoops

Started by JBR, February 22, 2021, 00:02:14

Previous topic - Next topic

JBR

Imagine I have a planet with a series of 'speed' hoops leading towards the planet & space station.

I have it really nice when you are flying by AI.

But I'm not sure how to get another ship to go through the hoops, order of hoops is not a problem, got that covered.

The best I have is AlignToVector, but it looks a bit naff! Quite an angle through the hoop.

Ideally I'd like a nice smooth transition but that sounds like maths!

I was thinking of flying directly to the front of the hoop at an angle and then straightening up to go through the hoop. Trouble is I'm going at a fair rate and maybe lose smoothness.

Any ideas/methods?

Any help gratefully received, Jim.

RemiD

i see 2 alternatives :

a combination of deltayaw / deltapitch (to determine the remaining angle), and turnentity (to turn around the local xaxis and local yaxis)

or

"bezier curves"
do a search on the old blitzbasic forum (mojolabs.nz)
and maybe somebody here can explain in more details (3d maths)


JBR

Thanks, went for the aligntovector method.

Basically when a ship gets within 100 units from the front of the gate it smoothly aims straight at the gate. Just getting the best timing.

Cheers, Jim.