Spherical Horizon

Working on a instrument project or just finished a project? Show it to others!

Moderators: russ, Ralph

Post Reply
Message
Author
JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Spherical Horizon

#1 Post by JackZ »

There are some rare cases where AM alone is not up to the task when creating an instrument.

I had to create a spherical horizon that had to not only rotate in Pitch and Roll as usaul, but also in Yaw so it displays the current heading. Turned out that this was impossible to do that in 2D

After a bunch of unsuccessful trials, I ended up with an hybrid version:
- The bezel, buttons, ILS needle and flags are pure AM
-The 3D sphere is displayed in 3D using javascript and a special 3D library (ThreeJs) in a browser window underneath. The code is relatively simple, and the mapping of the sphere texture is built in.
- To interface the Javascript code with P3D, I used a neat small server called FS TamTam.

The result is very satisfying.
image.png

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Spherical Horizon

#2 Post by Keith Baxter »

Hi,

Nice work Jacques.
Glad this inspired you to take it further.
https://www.forums.siminnovations.com/v ... 775#p29775

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Spherical Horizon

#3 Post by JackZ »

Thanks for reminding me this thread. out of curiosity did you manage to finish your project using canvas only?

I tried at first to recreate a 3D sphere completely in AM, but using a real 3D library in Javascript was way more easy (especially with this sphere that rotates freely around all three axis) and in my case it was way easier to map the texture onto the sphere. Like this I simply have to redraw a new texture to have a different model.
image.png
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Spherical Horizon

#4 Post by Keith Baxter »

Hi,

No I got distracted by other projects.
But I am happy that my efforts planted some seeds and there are new fruit emerging.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Spherical Horizon

#5 Post by JackZ »

TBH, i had completely forgot your work on the very same subject when I started this one, or else, I would have contacted you to have a try at your solution first.
But having to recreate the whole sphere markings in Canvas only was quite a NOGO for me, so I started to play with texture and move before switching to an extrenal solution which was easier.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Spherical Horizon

#6 Post by Keith Baxter »

JackZ wrote: Tue Apr 26, 2022 9:12 pm TBH, i had completely forgot your work on the very same subject when I started this one, or else, I would have contacted you to have a try at your solution first.
But having to recreate the whole sphere markings in Canvas only was quite a NOGO for me, so I started to play with texture and move before switching to an extrenal solution which was easier.

Jacques
Yes,

When features are not available we hack.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Spherical Horizon

#7 Post by Sling »

Think you could do this with canvas if you wanted.. Never seen an instrument like that. Obviously old but what aircraft?

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Spherical Horizon

#8 Post by JackZ »

I played with the display of one image per degree of heading, and played with canvas but there was always a special case where it didn’t work (including gimbal lock) and the quantity of code required for the 3D display was quite high and most of all the result was not satisfactorily especially with the texts, and I didn’t want to reinvent the wheel.

Couldn’t use in AM the sphere texture wrapping that was the most straightforward way to address the problem (texts are shrunk in different directions), a dozen of lines in JavaScript using the proper library was the key to success.
Granted the process involved is a bit tedious (start the FSTamTam server, launch a browser with the HTML/JS code, and place the AM overlay), but I solved it using a batch file that automated the process.

As per the gauge, It’s quite common in an old Jet fighter, like the F4 Phantom or the French Mirage. The horizon can also display the current heading and work inverted
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply