Creating an attitude HUD (aircraft)
by Adam Beer · in Torque 3D Professional · 09/28/2009 (12:35 am) · 11 replies
I am attempting to create a GUI object that displays a scrolling and rotating image. The goal is to create an attitude indicator for a heads up display in an aircraft. I have seen compass resources that rotate an image, but dont understand how I would scroll one.
Example:

The horizontal lines are part of an image that is made to loop vertically seamlessly and I need to know how that is done. Also, how would I get the control object's pitch to scroll the image in the first place?
Example:

The horizontal lines are part of an image that is made to loop vertically seamlessly and I need to know how that is done. Also, how would I get the control object's pitch to scroll the image in the first place?
About the author
Adam is the owner of Ignition Games, an indie game and software development company.
#2
09/28/2009 (4:12 am)
and how, exactly, did he fix it?
#3

Here is a youtube video of the attitude HUD in action on a real F16:
The attitude indicator is the horizontal lines that stay aligned with the horizon when the airplane rolls, climbs and dives. I have got the basic class setup, and have figured out how to rotate the bitmap in degrees but the problem I have now is how do scroll the image based on the control object's pitch?
Im sure just moving the bitmap is trivial, but it also has to wrap itself when the top or bottom of the bitmap is visible. Would anyone be able to help me out with this?
09/28/2009 (5:29 pm)
Alright so I guess I wasn't descriptive enough on the issue, so I'll try to explain more. I have this image that I am using as the texture for this gui here:
Here is a youtube video of the attitude HUD in action on a real F16:
The attitude indicator is the horizontal lines that stay aligned with the horizon when the airplane rolls, climbs and dives. I have got the basic class setup, and have figured out how to rotate the bitmap in degrees but the problem I have now is how do scroll the image based on the control object's pitch?
Im sure just moving the bitmap is trivial, but it also has to wrap itself when the top or bottom of the bitmap is visible. Would anyone be able to help me out with this?
#4
09/29/2009 (3:56 am)
Sorry, deepscratch. My post was in reference to his image not appearing. I should have posted again, rather than editing my first post. :)
#5
10/14/2009 (2:55 pm)
Is anyone willing to help do this for some $$$? Im pretty desperate at this point and have had no luck doing this myself.
#6
Search for Plastic Gem:: Animate Gui. It adds rotation to a bitmap image.
10/14/2009 (9:04 pm)
Adam if all you want to do is add functionality to an image to allow it to rotate then perhaps I can help you.Search for Plastic Gem:: Animate Gui. It adds rotation to a bitmap image.
#7
10/14/2009 (9:09 pm)
What I need is a little more complicated than that. It needs to scroll, rotate and constantly change the pivot at which it is rotating the image.
#8
10/14/2009 (9:45 pm)
Platic Gem's Animated Gui might put you a step ahead of where you are at right now. It does quite a few interesting things that could be interperted as those functions that you are talking about.
#9
10/15/2009 (12:09 pm)
in the horizontal compass, if you look at this,connection->getControlCameraTransform(0.032f, &cameraMatrix); Point3F cameraRot; cameraMatrix.getColumn(1, &cameraRot); cameraRot.neg(); cameraRot.z = 0; mOffset = Vector2dToOffset(cameraRot);theres your camera rotation, couldnt you just change the getColumn, and allow the z?
#10
10/15/2009 (1:44 pm)
Thanks deepscratch. That did work, but I am having trouble making it scroll the right way. I have it scrolling along the y axis of the texture, but I cant get it to scroll using the right camera axis.conn->getControlCameraTransform(0.032f, &cameraMatrix); Point3F cameraRot; cameraMatrix.getColumn(1, &cameraRot); // What column??? cameraRot.neg(); //cameraRot.z = 0; // ??? //cameraRot.x = 0; // ??? //cameraRot.y = 0; // ??? mOffset = Vector2dToOffset(cameraRot); RectI dstRect(getBounds().point.x + BorderOffset.x/2, getBounds().point.y + BorderOffset.y/2 + mOffset, texture->mBitmapSize.x, texture->mBitmapSize.y);
#11
07/08/2010 (7:28 pm)
The video was removed from you tube due to terms of use violation? I wonder what thats about...
Torque Owner Joe Melton
Fails At Making Games