February 25, 200719 yr Given a rotating SPRITE, I have been forced to deduce the zero point on the card experimentally. Originally, I had hoped that there zero point is the 3 o'clock position like needles, however this turned out to not be true.I'm betting there is a more direct method given the card's module var value and scale of rotation.For example, if I have a card using the KOHLSMAN_CARD_HG var which reports 29.92 as a starting value, and am using a scale of 60, how would I calculate the angle where to put that mark on the card?I suspected that I would take fmod(kohlsman * 60), but this doesn't seem to be correct either.
February 25, 200719 yr Patrick,Why are you using SPRITE for a Kohlsman setting??The Kohlsman value is really a NEEDLE, ie it rotates...surely there is no need to translate it either vertically or horizontally.Can't you use a NEEDLE then place a STATIC image above it with a transparent mask for the Kohlsman to show through?RegardsJim
February 26, 200719 yr Patrick If you do go for a SPRITE. Put your 29.92 in the 3 o'clock position.You will need to check on your BITMAP what angle there is between 29.92 and 29.93.. Lets say its 5 degrees. In your callback function you need to check the Kohlsman value. Lets say it 29.96..that means you have to rotate your card -20 degrees (2092-2096)*5 = -20So your callback function will return the value -20 and the card will rotate 20 degrees anti-clockwiseRegardsJim
February 26, 200719 yr I don't rotate the card, I let the sim do that. The point is to find the zero position the sim is using.However, I figured it out... my original thought was correct.You take 29.92, multiply by your scaling factor, and then mod by 360. ( 29.92 * 60 ) mod 360 = 355.2Now, subtract 360 once more: 355.2 - 360 = -4.8 degsAnd so the zero point is 4.8 CCW from the 3 o'clock position given this scaling and var.
February 26, 200719 yr Moderator Being a simple fool, I've always used a "needle element" to represent the rotating card... thus...return KOHLSMAN_SETTING_HGvar.var_value.n ; in my needle's callback is sufficient for my needs, when used with the non-linearity table:NONLINEARITY ALT_KohlsmanCard[] = {{{246,46}, 29.4, 0},{{280,69}, 29.5, 0},{{307,160}, 29.6, 0},{{324,146}, 29.7, 0},{{332,175}, 29.8, 0},{{329,216}, 29.9, 0},{{315,154}, 30.0, 0},{{293,188}, 30.1, 0},{{262,314}, 30.2, 0},{{226,332}, 30.3, 0},{{185,339}, 30.4, 0},{{145,335}, 30.5, 0},}; Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
February 26, 200719 yr >Being a simple fool...Bill, thats 2 lies in only 4 words...and you a man of the cloth..tut tut!JimPS: assuming that your Kohlsman readings are evenly spaced you could simplify your non-linearity table to first and last valueNONLINEARITY ALT_KohlsmanCard[] = {{{246,46}, 29.4, 0},{{145,335}, 30.5, 0},};
February 26, 200719 yr Haha. There I go again using a jack hammer. =)That is too funny. Great idea to use the needle macro since it doesn't move in x or y, makes more sense. For my tiny brain, it should have been called MAKE_ROTATE =)
February 27, 200719 yr >Great idea to use the needle macro since>it doesn't move in x or y, makes more sense. Yeah! not a bad idea from someone who (apparently) has never got an altimeter to work!!
February 27, 200719 yr Moderator >>Being a simple fool...>>Bill, thats 2 lies in only 4 words...and you a man of the>cloth..tut tut!>>Jim>>PS: assuming that your Kohlsman readings are evenly spaced>you could simplify your non-linearity table to first and last>value>>NONLINEARITY ALT_KohlsmanCard[] = {>{{246,46}, 29.4, 0},>{{145,335}, 30.5, 0},>};Really? Since I am indeed a "fool," and am likewise "simple," that leaves only "Being" and "a" as the questionable words......since I'm (apparently) not dead, I'm fairly confident in my state of "Being(ness)." I suppose it might be argued that since "me, myself and I" are an imperfect trinity, the "a" might be incorrect might be construed as ontologically a lie, although gramatically it is entire proper! :)Yes, the non-linearity table could be simplified... Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
February 27, 200719 yr Moderator >Haha. There I go again using a jack hammer. =)>>That is too funny. Great idea to use the needle macro since>it doesn't move in x or y, makes more sense. For my tiny>brain, it should have been called MAKE_ROTATE =)Feel free to edit your fsgauges.h to whatever makes you happiest! ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
March 2, 200719 yr Actually, there is a reason that I used a SPRITE too... I am using a mask to allow me to do some other things. =)
March 2, 200719 yr Moderator >Actually, there is a reason that I used a SPRITE too... I am>using a mask to allow me to do some other things. =)>Actually, for reasons unrelated to any visual effect, there is an excellent reason for using a SPRITE with its mask:...in the VC, elements such as a compass dial tend to "deform" when the corners of the square bitmap are rotated outside the bounds of the background image. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
March 2, 200719 yr Bill,Thanks for this tip. I had just finished the VOR2 using the NEEDLE vs. the SPRITE as an exercise, and to reduce the number of bitmaps.I did so after also noticing that MS's gauge must use NEEDLE due to the lack of a mask in their .dll.Now, before converting the ADF to NEEDLE (if I ever get around to that anyway), I'll check them both out in the VC to make sure they look ok, and use the SPRITE if this effect is noticable.
March 3, 200719 yr Moderator >I did so after also noticing that MS's gauge must use NEEDLE>due to the lack of a mask in their .dll.Which gauge set? The two VORs in the c172 gauge set both have masks for the compass card:VOR2#7026.....compass card#7027.....compass card mask#7526.....compass card hi res#7527.....compass card mask hi resVOR1#7037.....compass ring#7038.....compass ring mask#7537.....compass ring hi res#7538.....compass ring mask hi res...and of course the "night time versions" of both lo res and hi res graphics as well... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment