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.

AppGameKit Classic Chat / How does SetObjectUV on Planes work right? Or how can I repeat textures on planes

Author
Message
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 5th Mar 2017 07:30
I wanted to have a cube and a plane (ground) with the same texture, but also with the same tiles. So my idea was, to scale the UV, to put more of the texture tiles next to each other.
But maybe SetObjectUVScale is the wrong command. And I need sometimnge like SetObjectUVTile, or SetObjectUVStretch ...
Or: SetObjectTextureRepeatXY

The idea was, to not have separate objects, but maybe it is the better way, to have 40 x 40 planes with one texture, insteat of having a plane 40*20 (800) by 800 with 40 by 40 "tiles"




Thanks for help. Kind regards.

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 5th Mar 2017 09:28
me try this with SetImageWrapUV but i get only one small piece but not repeated, seems its broken in 2017.02.28? pc & android.
AGK (Steam) V2017.02.28 : Windows 10 Pro 64 Bit : AMD (17.2.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 6th Mar 2017 20:41 Edited at: 6th Mar 2017 20:52
I needed all of them

SetObjectImage(oplane,itex,0)
SetImageWrapU(itex,1)
SetImageWrapV(itex,1)
SetObjectUVScale(oplane,0,20,20)

And I can't strech (clamp) the same image on one object and tile-repeat it on another object. Therefore I need a copy of the image or a new-subimage from the same source.
But I can use another tile-size per mesh. So maybe 0.5 Scale on one and 10 on the another. On the first, it will be streched bigger, because a half tile (texture) is for the complete mesh, and in the other option you have 20 tiles for one mesh, so they will all be smaller and repeat.

// CopyImage( newImage, fromImage, x, y, width, height )

Login to post a reply

Server time is: 2024-11-24 19:45:07
Your offset time is: 2024-11-24 19:45:07