Sign in to follow this  
Guest Skymed

fixing the 'axis' of a rectangle, or line

Recommended Posts

in a bitmap 'axis' is used to referance a rotate command.when the line shifts and rotates fine but i do not know how to define the axis. it is rotating on the 0,0 i tried & both ignored. so whats the deal ?i would also like to know how to draw a line, and a circle if im lucky enough to snare an 'expert'.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Well I will try my best to help:here is an artificial horizon line (actually a very thin rectangle) used in a HUD I made a while back. It is "pinned" to the center of a 480 by 480 rectangle, so it is pinnned at position 240,240 in the center of that. It moves up and down (pitch) and rotates (bank) according to the horizon: (L:Horizon,enum) 1 == (A:Attitude indicator pitch degrees, degrees) /-/ 5 * (A:Attitude indicator bank degrees,radians) 1.07 *So it pivots on the center of the rectangle and that center is "pinned" to the center of the background it is on.here is a W shaped version of the same thing: (L:Horizon,enum) 2 == (A:Attitude indicator pitch degrees, degrees) /-/ 5 * (A:Attitude indicator bank degrees,radians) 1.07 *Now a circle: This circle represents a VSI moving up and down. The difference here is where the circle is "pinned" on the background to be centered on the screen BUT the pinning point is as if the circle was drawn on an invisivle square and the top left corner of that square is used for position it. (L:Train,bool) 0 == (A:Vertical speed, feet per minute) 3 * I hope this helps.Steve

Share this post


Link to post
Share on other sites

thanks steve, it will take a while to digest. thats pretty close to exactly what i was working on.i found the pivot (like i mentioned in the original post) in the fs9gps500 gauge. i was mis-using it earlier. i went back and changed from a rctangle to a polyline...an example of polyline rotation is in the gps gauge. i have not seen a circle manipulated before....great examples of lines rectangles and circles....vectors 101! how do you 'mask' them...forgive the bitmap referance but thats what i know... how to contain them....with in the confines of...say a hud glass...to stay with your examples?

Share this post


Link to post
Share on other sites

Masking, in the sense of hiding them behind other elements.......I have no idea. Constraining them within certain boundaries, however can be done by using / setting limits on how far they are allowed to move. The VSI circle exapmle is constrained to move within the confines of the HUD so that the circle is always visible.Steve

Share this post


Link to post
Share on other sites

Hi,You can also use the "CLIP" Command.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

....clip....? only one example of clip in gps500......which does not make sense to me at 1st glance, what is ( several of those) in gsp500nuther question;can points 'x'&'y' be dynamic ?point x="var1" y="var2"

Share this post


Link to post
Share on other sites

ok ...played with clip....gps500 example ( still seems odd ) was not best example to learn from. but top,bottom,right,&left work great, not in the vector statement, but inside the element. ( long as rectanglular boundries suffice).starting to like the custom draw and vec stuff...pretty powerful!can other parameters be dynamic? radius, width, hieght....etc.is there a list where i can browse custom draw options?how bad is processor hit for this....compared to bitmaps?

Share this post


Link to post
Share on other sites

I wouldnt worry too much about cpu hits on a decent computer.And yes these vectors can be dynamic. here is an example of a hover gauge as used in Blackhawks. Basically it is a circle, with a rectangle inside it that expands or shrinks according to a predefined height. When the rectangle touches the circle the helicopter is at the correct height. Using the widthcode and heightcode the rectangle is enlarged or shrunk real-time. For testing you could just change my custom L vars to rad alt to see what it does.Again notice the square is "pinned" at the center of a 480x480 background and is constrained to a certain size. Furthermore again the circle is "pinned" according to as if it was drawn on top of a square piece of paper and we use the top left hand corner for the locating.(L:zeroradalt,feet) (L:HOVER,feet) * (L:zeroradalt,feet) (L:HOVER,feet) * (L:zeroradalt,feet) (L:HOVER,feet) * Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this