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.

DarkBASIC Professional Discussion / Scale texture along a plane

Author
Message
Zwarteziel
15
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 18th Jul 2012 11:51
Hi all,

some time ago, I started working on a minimap after discussing several techniques in this thread. So far, I've made routines that use sprites, memblocks and bitmaps. Each have their pro's and cons, and I'm now looking into the possibility of scrolling and scaling a minimap-texture across a plane.

I've come up with this simple code:


The scrolling works, but the scaling does not. I've searched the forum and read the command (once?) had a bug that prevented textures from scaling correctly. It's supposed to be fixed, so I'm guessing I'm doing something wrong myself. Can somebody point out what that is? I've added the code and image used as an attachment to this post.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Jul 2012 13:12 Edited at: 18th Jul 2012 13:18
Have a look at this simple demo (image attached). The scaling is permanent so if you scale it twice by 5% then the net effect is 1.05*1.05 = 1.1025. I believe the scroll object texture command works the same way except the effect is additive rather than multiplicative.

When you run the code press x or y briefly and compare the values shown on screen with the actual scaling - the variable totalXScale# shows the final amount of scaling for X.

Hope this helps.



Edit Forgot image (any image will do of course).
Zwarteziel
15
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 19th Jul 2012 00:22
Thank you very much for your help Green Gandalf... that code snippet is very informative!

Login to post a reply

Server time is: 2026-07-07 14:23:35
Your offset time is: 2026-07-07 14:23:35