Any way to "tile" a texture onto an object?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Any way to "tile" a texture onto an object?

Post by Josh1billion »

I'm using irrEdit, in which I have created some cubes (not square cubes, but walls) and applied a brick texture to them. The problem is that the texture is apparently being stretched along each side of the cube, which looks very bad on some sides of the cube.

Is there any way to have the texture "tiled" along the cube instead of stretched onto it?
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

How did you make the cubes? You need to define proper UV coordinates in your modeling program
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Post by Josh1billion »

I just used the "insert cube" function of irrEdit.

I forgot to mention that I'm doing all this in irrEdit. :P
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Post by Josh1billion »

Anyone know?
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

create your own cube using max/blender/etc and set the uv
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You should be able to do this by applying a texture transform.

Travis
Slippy
Posts: 13
Joined: Fri Dec 19, 2008 3:52 am

Post by Slippy »

Take a look at THIS page.

Code: Select all

node1->getMaterial(0).getTextureMatrix(0).setTextureScale(sx,sy);
Instead of setTextureScale(sx,sy). I used setScale(), and it tiled the texture.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should keep with the texture matrix methods, as they'll put the values into the proper places.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

I'm not sure if you can set UV inside IrrEdit. I've never done it, what I usually do is use a modeling program such as Blender and model in there, for example a cube, and then set the cube's UV coordinate in Blender. Export the cube to obj file format and open it up in IrrEdit.
Image
Post Reply