Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / An Algorhithmic parallelogram shink effect problem.

Author
Message
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 12th Jun 2006 03:43
Hi ,

I have a little problem.

I have one world map and I want to make one effect on the map.

I want to make concentric parallelogram on the map , but these
parallelograms , will shrink from outter to the destination x,y on the map.


But the destination of shrink effect will change if the x,y possition will change. (for example the mouse possition).

I have attached example to see what I mean.

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Jun 2006 06:27
x1,y1,x2y2 defines the initial box (unzoomed).
x,y the point to zoom in on.

c = 50

xa# = x-x1
xb# = x2-x

xa# = xa#/c
xb# = xb#/c

Then in the zoom loop:

x1 = x1 + xa#
x2 = x2 - xb#


Same thing for Y. I think that'd work.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 12th Jun 2006 14:05
I didn't understand well ,

I try to use this example ,

but

I dont have correct resaults yet.

I made this code , but is something wrong.

Where I put these lines?
-------------
xa# = x-x1
xb# = x2-x

xa# = xa#/c
xb# = xb#/c
-------------

My example code.



The map image is attached.

Attachments

Login to view attachments
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 12th Jun 2006 14:56
Then I made something more interest with this code.



I am very close.
The only thing that left , the destination square must be in the
center of the mouse direction in zoom in.
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 12th Jun 2006 15:37 Edited at: 13th Jun 2006 20:01
I did something better.

Thank you very very much.

You solved me, the problem about zoom in the map.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Jun 2006 23:00
Here's an actual example. (had to use floats, integers were throwing off the precision)



"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 13th Jun 2006 19:56
Thank you very much again.

And This one is very very usefull.

I will put is in my Game.

Login to post a reply

Server time is: 2024-09-25 01:26:32
Your offset time is: 2024-09-25 01:26:32