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 / Sprite texture scrolling

Author
Message
EvilFurniture
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 17th Sep 2003 14:45
I was bangin my head how to scroll a texture on a sprite, so that it wraps around on the edges, like it would if u made a plain object and texture it, then use scroll object texture. I want to use a sprite because it is significantly faster then using a quad.

I don't really know how to make it right, the texture just runs of in some direction, not wrapping it around (i use the "set sprite texture coord" command, naturally)

Any ideas would be greatly appriciated.
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 17th Sep 2003 14:57
See DBPro Quickstart Tutorial 1 on the Developer site here (click the "Developers" link at the top).

Cheers,

Rich

The sky above the port was the colour of television, tuned to a dead channel.
Your brain's just like any other appliance: it works better if you plug it in...
EvilFurniture
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 17th Sep 2003 18:16
am i just being dumb here or does the technique described in tutorial 1 apply only to vertical scrolling? If i change the u coordinate, the texture does not wrap, if i change the v, it does? what gives?
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 18th Sep 2003 01:40
You're not being dumb, it's just that UV mapping works like that. You could modify the code to handle horizontal scrolling I believe, perhaps someone will show how. You can't just change the coordinate though.

Cheers,

Rich

The sky above the port was the colour of television, tuned to a dead channel.
Your brain's just like any other appliance: it works better if you plug it in...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Sep 2003 03:00
Rotate your image 90 degrees one way, rotate your sprite 90 degrees the other way, then use horizontal UV scrolling.
EvilFurniture
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 20th Sep 2003 14:05
Thats a very good idea but unfortunately i think its not fast enough for my use. I need both horizontal and vertical scrolling simultaneously on one sprite, every frame. Rich i thought there was no major difference between uv mapping of a plain object and uv mapping of a sprite object. Aren't they both "3d", only that sprite has already transformed vertices? How come its possible to scroll the texture on a plain object and not on a sprite? Can't the implementation of uv scrolling be the same for both?

Login to post a reply

Server time is: 2026-07-25 07:01:44
Your offset time is: 2026-07-25 07:01:44