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 / Scrolling textures along planes?

Author
Message
jobromedia
14
Years of Service
User Offline
Joined: 9th May 2012
Location: Stockholm, Sweden
Posted: 16th May 2012 04:51
Once again back with another question, here goes:

I got a water texture and a plane. Is there a way to scroll the texture along the plane? Or do I need to use multiple planes to scroll the texture?

Thanks in advance.

MIDI packs for sale.
Best regards
Johan Brodd
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 16th May 2012 05:07 Edited at: 16th May 2012 05:11
SCROLL OBJECT TEXTURE Object Number, X, Y

If I remember right, do it in small intervals. The values represent affect the UV data of the object which range from 0.0 to 1.0 So, 0.5 would scroll it halfway each update, while 0.1 would scroll it 1/10th each update.



Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
darkvee
20
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 16th May 2012 05:17
Hi man,

Using 0.007 or something like that is what is needed maybe for 60 fps.

Try this:
scrollX = scrollX + 0.007
scroll object texture myObjNum, scrollX, scrollY

TIp: Make sure scrollX & scrollY is floats or it won't work.

darkvee

Login to post a reply

Server time is: 2026-07-22 06:01:29
Your offset time is: 2026-07-22 06:01:29