Animating a 3D Gauge

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
User avatar
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Animating a 3D Gauge

#1 Post by BradyBrother100 »

Hey! I was wondering if there is anyway to animate a 3D gauge such as the Attitude indicator in the PMDG 737 or in the Colimata F-18 in X-Plane. Unlike a gauge in a Cessna, the Attitude indictors in the PMDG 737 or the F-18 look very 3D. Is there anyway to simulate that in Air Manager?


Thanks!
Brady

User avatar
Ralph
Posts: 7924
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Animating a 3D Gauge

#2 Post by Ralph »

No 3D, sorry.

User avatar
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: Animating a 3D Gauge

#3 Post by BradyBrother100 »

Ok, do you know if there is anyway to mimic 3D? I am trying to code a F-18 Attitude Gauge where the gauge would spin according to the pitch of the aircraft. That would mean the gauge would have to spin on the Z axis. Any suggestions?

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

Re: Animating a 3D Gauge

#4 Post by Keith Baxter »

Hi Brady,

Welcome to the forum.

Yes you can using cancas_draw(). You will need to go through Tony' videos. Then apply some math using Stereographic projection.

https://en.wikipedia.org/wiki/Stereographic_projection

It can be done. I have played around with revolving a map globe. But you are going to have to do it. Have fun. It is a great learning curve and I look forward to seeing your results.

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
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: Animating a 3D Gauge

#5 Post by BradyBrother100 »

I will try that! Thanks.

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

Re: Animating a 3D Gauge

#6 Post by Keith Baxter »

BradyBrother100 wrote: Tue Oct 13, 2020 8:00 pm I will try that! Thanks.
Hi Brady.

I suggest that you draw your instrument using polygons and store those coordinates in a .json file. Once that is done then you should be able to manipulate the coordinates using some math in about 100 lines or so.

This should give you some inspiration. The code do do this is about 80 lines. The json file with all the country polygons, about 1500000 lines.

https://youtu.be/2QRQhuzT7m8

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
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: Animating a 3D Gauge

#7 Post by BradyBrother100 »

Thanks for the video! I will definitely try that although it will definitely take some time.

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

Re: Animating a 3D Gauge

#8 Post by Keith Baxter »

BradyBrother100 wrote: Tue Oct 13, 2020 8:55 pm Thanks for the video! I will definitely try that although it will definitely take some time.
Hi Brady,

Pleasure. Once a few instruments hit the store and peeps start getting the coding concept. It will become a craze. :mrgreen:

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
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Animating a 3D Gauge

#9 Post by Keith Baxter »

Hi Brady,

I had look at the instrument that you want to replicate. Very easy to do. :mrgreen: I can see wet compasses popping up in the store soon.

I did a quick and dirty mod to the globe.



I will try and do a concept gauge to speed you up and post here. You will have to take what I provide and refine.

Give me a day or so as I am on another project ATM.

Also I just want to make it clear. This is a simulation. You cannot do this with .PNG files that I know of. Ralph indicated that in his post.

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
Ralph
Posts: 7924
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Animating a 3D Gauge

#10 Post by Ralph »

We had a similar question a while ago, from a company. The part where it gets tricky is when the sphere is going to rotate in all directions, and things project on the sphere need to move in the correct direction and change size if they move away or come closer, and they need to rotate in the correct direction as well. If you put a lot of time into it, it might be possible, but it'll be a struggle.

Post Reply