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 / Repeating an image on a model

Author
Message
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 20th Apr 2013 20:56
I have a flat surface with a a texture on it that is supposed to repeat but i'm getting weird results in agk (the image shows in the center of the surface then seems to just stretch out to cover the rest) while it looks fine in blender.

How do you set the image to repeat over the surface.

Also how do you get rid of this weird result when you don't want the texture to repeat at all?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Apr 2013 22:05
Have you tried using setImageWrapU and setImageWrapV on the image after loading? That might solve the problem.


this.mess = abs(sin(times#))
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 21st Apr 2013 00:44
If exporting UV's after you've mapped 'em in Blender doesn't work when you load the .obj, how about just changing your texture so it repeats to the right size? Also make sure you keep to the power of two with your texture image.

And I'm not sure what you mean by getting rid of this weird result. But AppGameKit will paste your texture (on a plain) from top left corner to bottom right. If you want this to change your have to load your own shaders.

My hovercraft is full of eels
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 22nd Apr 2013 02:49 Edited at: 22nd Apr 2013 02:57
baxslash's suggestion was what I needed.

I was looking for the functions in the Object section, didn't think to look in the Image section since I thought it would be an object property rather than an image one.

The weird result I was talking about, is this image(it's hard to see since its a png with only white and transparency but you can just make it out thanks to the off-white colour of this forum background)...



...applied to a flat hexagon model with SetImageWrap mode as 0 or not using the SetImageWrap functions at all...



...then the same image applied to the same model using SetImageWrap mode as 1...

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Apr 2013 11:05
I'm not sure if it would be better if wrap mode was set to 1 by default to be honest...


this.mess = abs(sin(times#))

Login to post a reply

Server time is: 2024-11-24 11:51:54
Your offset time is: 2024-11-24 11:51:54