Board index FlightGear Development Canvas

Any other have this translation issue?  Topic is solved

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.

Any other have this translation issue?

Postby Necolatis » Sat Feb 23, 2013 10:45 am

The problem is in the header scale I made, I looks like this:

https://sites.google.com/site/fghangar/ ... edirects=0

What I did was draw 20 degrees of the scale, and move it 5 degrees from side to side.

To give the illusion of the scale moving, I add a minor tick in the left side, when the scale moves to the right, and vice versa.

The scale and the outer ticks are in same group, so gets translated together. The ticks I switch on and off with show() and hide().

Here the left is shown, and the right is hidden:

https://sites.google.com/site/fghangar/ ... edirects=0

What happens in the loop when I must move the scale opposite what the illusion should be:

translate the group, hide the tick opposite the translation direction, show the other.

If I yaw towards higher heading, the right side works real good.
In the left side, a split second before a translation happens the tick which is hidden, gets shown.

It does not matter what order I do it in.

It is as if a show() and hide() happens instantly, but a translation on a transformation takes a split second.

Have any other experience this issue?

Is there smarter ways of making a scale that does not span the entire width of the HUD?
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2118
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Any other have this translation issue?  

Postby TheTom » Sat Feb 23, 2013 11:08 am

Necolatis wrote in Sat Feb 23, 2013 10:45 am:It is as if a show() and hide() happens instantly, but a translation on a transformation takes a split second.

Thats exactly the way it is done. As changing translations can change multiple entries in multiple matrices updating matrices is only done once per frame (always delayed one frame). If you need the matrix to update immediately, calling update() on the according element after changing the translation should make it change immediately.

Necolatis wrote in Sat Feb 23, 2013 10:45 am:Is there smarter ways of making a scale that does not span the entire width of the HUD?

If I have understood your method correctly it already seems to be a good solution ;)
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: Any other have this translation issue?

Postby Necolatis » Sat Feb 23, 2013 6:47 pm

Nice, works. :)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2118
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10


Return to Canvas

Who is online

Users browsing this forum: No registered users and 2 guests