News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

inverse tan and aslo rotating graphics?

Started by Retsim_X, November 13, 2005, 05:14:29 AM

Previous topic - Next topic

Retsim_X

question 1 how do i quicly calculate invers tan?

question 2 how do i rotate graphics? donky has a graphics routine to do so but i realy need help in on that keeps the image at a constant scale size donkey's resizes the image to fit in the same bounds

Siekmanski

Hello Retsim x86

Inverse tan is the same as arctan

You can use the fpu to calculate it:

fld   value
fld1
fpatan
fstp st
fstp value  ;inverse tangens

How do you want to rotate a picture, compute it by yourself or use DirectX ?
Let me know and I will help you as good as I can

Here are some old sources (Protectedmode  Picture zoom rotator/distorter ) I translated years ago from one of my Amiga-demo routines


http://members.home.nl/siekmanski/rotatepic_old.zip

have fun



Retsim_X

hi Siekmanski

thanks for that inverse tan solution :)
i tryed a similar tackt but unfortuintly i used fptan lol
arc tan hehe i knoew that sorry

it works a charm

now i would like to rotate the graphics myself in the program

thank you

raymond

Quotefld   value
fld1
fpatan

The above leaves the result (in radians) in st(0). :clap:

Quotefstp st

That would destroy the result in st(0). :naughty:

Quotefstp value  ;inverse tangens

With this sequence, whatever is stored in the value variable would be what was in st(0) immediately before loading the tan value on the FPU with the first instruction. If the FPU was then empty, the INDEFINITE NAN would be stored and the Invalid operation flag would be raised.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Retsim_X

hello agian

yeah
i discovered that thers no problem with donkeys graphic routine GetRotatedBitmap :)
turns out the problem is that i didnt know what i was doing
lol sorry

anyway i finished my overall fire danger calcu;ater yesterday withe the half circle with the different grade
extreme
very high
high
medium
and low

and needed getrotated bitmap for the rotation of the pointer on the fire chart :)

all i needed to do was write a simple routine (TransparentBlt) similar to the one in delphi
to remove the white mask of the pointer bitmap :)

now it works a treat thanks
:clap: :lol ::)

Siekmanski

hello guys

Sorry for that stupid mistake, must have been drunk  :P