March 05, 2021, 07:01:30 PM

Author Topic: Going through hoops  (Read 196 times)

Offline JBR

Going through hoops
« on: February 22, 2021, 12:02:14 AM »
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.

Offline GfK

Re: Going through hoops
« Reply #1 on: February 22, 2021, 09:30:08 AM »
There's a delta parameter in AlignToVector.  Use that to turn gradually.
Intel I9-9900K 3.6-5.0GHz | GeForce RTX2070 8GB | 32GB RAM | 500GB NVMe M.2 SSD | 1TB HDD | Windows 10 x64.
MSI Apache Pro | I7-7700HQ | GeForce GTX1060 3GB | 8GB RAM | 128GB SSD | 1TB HDD | Windows 10 x64.

Offline RemiD

Re: Going through hoops
« Reply #2 on: February 23, 2021, 09:51:42 AM »
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)


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

DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline JBR

Re: Going through hoops
« Reply #3 on: February 24, 2021, 01:08:19 AM »
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.


SimplePortal 2.3.6 © 2008-2014, SimplePortal