Artifical Horizon?
3 posts • Page 1 of 1
Artifical Horizon?
I'm working on some new planes at the moment and would like to try a HUD or data readout for them.
All the simple stuff, like engine power level & gear up/down is simple, and can be done easily while still being phunlet safe. Here is the situation;
I have created a large tall & thin texture that loops around the top to make an artifical horizon scale;
I want it to take an an angle between 0, 2pi or +pi, -pi (Whatever is easier) and move the image up/down a square object and when the aircraft is level, you should only see the centreline and +/- about 60 degrees.
Here is what I have so far;
The sixth entry in the textureMatrix variable or textureMatrix(5) is the value that when changed from 0 to 1 moves the image up/down, with 0.5 positioning it "horizontal". Created a variable, "Scene.my.pitch" to store the pitch from pi/-pi. This then gets used like so;
Something like a k-probe is being used to get data like angles.
But, when I try to put the code in the onlaserhit box it won't stay and will simple vanish, so I am obviously doing it wrong, How do I go about modifiying textureMatrix?
All the simple stuff, like engine power level & gear up/down is simple, and can be done easily while still being phunlet safe. Here is the situation;
I have created a large tall & thin texture that loops around the top to make an artifical horizon scale;
I want it to take an an angle between 0, 2pi or +pi, -pi (Whatever is easier) and move the image up/down a square object and when the aircraft is level, you should only see the centreline and +/- about 60 degrees.
Here is what I have so far;
The sixth entry in the textureMatrix variable or textureMatrix(5) is the value that when changed from 0 to 1 moves the image up/down, with 0.5 positioning it "horizontal". Created a variable, "Scene.my.pitch" to store the pitch from pi/-pi. This then gets used like so;
- Code: Select all
textureMatrix(5) = (scene.my.pitch + math.pi) / (2 * math.pi)
Something like a k-probe is being used to get data like angles.
But, when I try to put the code in the onlaserhit box it won't stay and will simple vanish, so I am obviously doing it wrong, How do I go about modifiying textureMatrix?
-

Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
Re: Artifical Horizon?
search in forum for texture transformation
viewtopic.php?f=13&t=2903&p=34142&hilit=textureMatrix#p34142
viewtopic.php?f=13&t=2903&p=34142&hilit=textureMatrix#p34142
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Artifical Horizon?
Ahhh thanks, that is what I was trying to find. Luckily i've just cover matrices at uni so the maths doesn't seem too hard.
Edit, thanks again, this is what I came up with;
Edit, thanks again, this is what I came up with;
-

Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests




