Board index FlightGear Development Canvas

HUD gyrocompass

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

HUD gyrocompass

Postby 5H1N0B1 » Tue Aug 20, 2019 12:45 pm

Hi,
I'm working on an HUD, and I was wondering how to make a gyrocompass on a canvas. My main issue is that I do not want this gyrocompas to cover the full hud span.
This is an example bellow : (because a picture is sometime better then any explanation)
Image

I'm trying to do that with
.moveTo(
.vert(
.setStrokeLineWidth(

I have no clue on how to do that.
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 222
Joined: Thu Aug 30, 2012 10:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu

Re: HUD gyrocompass

Postby Thorsten » Tue Aug 20, 2019 1:29 pm

My main issue is that I do not want this gyrocompas to cover the full hud span.


Set a clipping region - the Shuttle HUD ought to have examples for that (if you're out of luck, the Shuttle PFD for sure has, but that code is lengthy)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: HUD gyrocompass

Postby 5H1N0B1 » Tue Aug 20, 2019 5:32 pm

Thanks !
I'll look through it.
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 222
Joined: Thu Aug 30, 2012 10:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu

Re: HUD gyrocompass

Postby Octal450 » Tue Aug 20, 2019 6:58 pm

You can also use Richards clipping code. Essentially you can make an object with the region you want visible, name it the name of the object you are clipping with _clip, like HDGTape_clip and then his code will clip it automatically.

See my IDG MD-11 PFD for examples.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: HUD gyrocompass

Postby 5H1N0B1 » Sun Oct 13, 2019 3:01 pm

Thanks a lot for your answers.
This is working great.
Image
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 222
Joined: Thu Aug 30, 2012 10:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu


Return to Canvas

Who is online

Users browsing this forum: No registered users and 4 guests