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.

2D All the way! / Distorting Sprites

Author
Message
Dilv
21
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 8th Sep 2006 20:34
Hi guys, Im looking for a way to distort sprites in such a way to achieve the replication of height. Ive got an example of how to do this but......Its in blitz3d and I dunno what Im doing in blitz at all. The guy who made the example did include a tutorial on how to achieve height using a technique which you deformed the sprite image streching it and rotating it (which can be done in DBPro easy) but he also mentions about altering the four corners of the sprite seperatly. I was wondering if anyone knew a way to do this? or if anyone is any good at Blitz and can convert his code to DBPro. I'll post the code if someone requests it.

Ive included an image of what effect im after, on the right hand side is the tileset used by his app which proves the distortion is done 'on the fly' and not re made tiles.
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 8th Sep 2006 20:39
Post the Blitz code here, maybe someone can convert it for you.

"Bite my shiny metal ass" - Bender, Futurama
No pixels were harmed in the making of this post
"Don't ping my cheese with your bandwidth"
Dilv
21
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 8th Sep 2006 20:47
Ok heres the code.........



And for those who want to download it here is the zip with images and .exe etc.
Dilv
21
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 9th Sep 2006 14:27
Hey guys, Ive started to translate the code myself now, Im making good progress (while tryint o look after my nephew lol) but am stupped on one command. The command in blitz is ImageRectCollide


If you cant understand what it does basically it checks if a sprite is in a defined area on the screen, not if 2 objects are colliding. I was wondering if DBpro had an simlair command or am I best trying to go about making my own function to replicate this???
RUCCUS
21
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 18th Sep 2006 05:25
You mean like this?



Will return 1 if sprite position is inside the rectangle, otherwise 0.

Sprite = Sprite number
RectX#/Y# = Rect Start X/Y position
Width#/Height# = rect width/height

Not tested but it should work.

Your signature has been erased by a mod because it's larger than 600x120...

Login to post a reply

Server time is: 2026-07-07 03:23:13
Your offset time is: 2026-07-07 03:23:13