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! / Realtime seamless texture

Author
Message
Daryn Alsup
14
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 19th Apr 2010 00:33
So I have a texture mapped to a sphere - on this texture, clouds are drawn. Let's say that this image is 10 X 10. When a pixel is moved from 1, 9 to 1, 10 - the clouds appear to move. When it moves again - instead of it drawing (the loop) at 1, 1, it draws from 2, 1. Is there anyone who can help me figure out how to 'loop' the pixels or can help me understand how to write a function for this process?

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Link102
18
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Apr 2010 01:54
if it's mapped to a sphere why don't you just shift the uv's?

Daryn Alsup
14
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 19th Apr 2010 05:40
I don't need to move the texture - the texture remains the same... it's the pixels of the texture that change - dynamic weather. think of each pixel as part of a cloud... as the cloud floats across the texture (and changes shape) different pixels are colored white. I am trying to prevent the pixels drawn on the texture from moving down the sphere (think of two "for loops," X and Y, the total = 10 for both. the loops will work as
) This causes the clouds to offset and draw abnormally on the sphere... and because the pixels of the texture are colored based on temperature and pressure, just scrolling the texture doesn't work.

When pixels are drawn, they are drawn in this manner. I need to find a function that wraps the pixel back to one when it reaches the full size...



I couldn't get the above to work

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Green Gandalf
VIP Member
18
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Apr 2010 18:17 Edited at: 26th Apr 2010 18:18
If you're using the 2D and bitmap commands for this then pixel X and Y coordinates are numbered from 0 to width-1 and from 0 to height-1 so perhaps your function should be



This is just a guess as I haven't seen the rest of your code.

Login to post a reply

Server time is: 2023-01-29 05:18:11
Your offset time is: 2023-01-29 05:18:11