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.

Newcomers DBPro Corner / Scaling textures? How do I do that?

Author
Message
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 7th Jun 2007 15:12 Edited at: 7th Jun 2007 15:13
Hi all.

I'm working on an game, and have some up with an very dynamic and flexible way to create maps. It will create an room of gives sizes and will then fill it with the given objects. But there is ONE problem. When I apply textures to the walls, the floor and the roof, it gets all wrong.

The textures are stretched out. So I want to know, how do I scale the textures so they are not stretched? The ideal would be to make so if I texture an object (lets say a wall), the texture will be put out side by side untill the object is filled. Is there an way to do this?

Ohh, and the reason I do not simply create larger textures is that the maps are so dynamic. You can change the texture of the walls just by changing one line in the file. And I want it to be possible to choose any file, not just the one for the walls.

Anyway, if you have any idea of how to do this, please help me. When it comes to these things, I'm an complete noob.
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 7th Jun 2007 18:35
SET OBJECT TEXTURE Object Number, Texturing Mode, Mipmap Flag
SCALE OBJECT TEXTURE Object Number, UScale, VScale
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 7th Jun 2007 21:02
I tried those commands, but could not figure out how they work. Is there an tutorial about them somewhere? Or could someone please post more in detail about how to use them. Because I really need to understand them to do this, so it would really help to 'se them in action'.

Anyway, at the moment I'm using quite large boxes as floor, walls and roof. Would it be better if I instead of using the texture directly on them, I would create plains in front of them, which I texture, instead of texturing all six sides of the boxes?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th Jun 2007 00:14
SCALE OBJECT TEXTURE is what you want.

Default mode for texturing is to stretch your image so it covers each face. SCALE OBJECT TEXTURE allows you to tile the texture across each face by however many times you want. So if you had a long wall for instance that was 100 units by 40 units high, you may wish to tile the texture 5 by 2 so everything is nicely ratioed, so just SCALE OBJECT objnum,5,2 - simple as that. Beware though that is applies that tiling to every face, so for cubes and boxes made to look like walls, the thin edges of the walls will look squashed.

Boo!
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 9th Jun 2007 13:10
Got it to work . Thank you for your help.

Login to post a reply

Server time is: 2024-11-25 17:34:17
Your offset time is: 2024-11-25 17:34:17