Game Development Community

Texture Scale with Gamespace

by RichardoSmith · in Torque Game Engine · 01/13/2005 (8:29 pm) · 8 replies

Does anyone know where a very good step by step
tutorial is for:

Adding objects (.dif) to Torque from gamespace.
Scaling the textures and making them work right.
most importantly how to get them scaled and appearing right
and lined up as they are in gamespace

#1
01/13/2005 (8:41 pm)
Richard, that depends greatly on what you're using. Since I know that you're using mapExporter, and that translates the UV coordinates to the form of UV mapping that the .map format uses, try to keep the mapping as simple as possible. That is, planar and cube mapping, as well as normalizing the orientation of the brushes- Not sure that I mentioned that before, but you can have an object standing straight up and then find that it's rotation is something like "205 89 156". But that's because of the axis, and when that brush is exported through mapExporter, it's exported at that rotation, and if the UV mapping has an orientation of "0 0 0", then you might get some problems.

One thing to do, if you've rotated a brush:
- Click on the Show Axis Tool, which reveals the axis of an object.
- Click the Move Axis to Center of Object tool, which centers the Axis(unless you need it uncentered for something).
- Click the Normalize Rotation tool, which will correct the rotated axis of the object, but not rotate the object itself. At this point, the object is normalized to a rotation of "0 0 0".
- Click the Show Axis Tool again to hide the axis.

I think I need to bust out another tutorial or two on mapExporter :)
#2
01/13/2005 (8:48 pm)
Ok..
I tried getting a texture to appear properly
without any rotation on any of the planes, x,y,z.
The texture however shows up as :
Too small or too large,
oriented left or right.
I use the offset and rept tweaks but just can't seem
to get it right.
There has to be a formula to ensure that these come out
right. Like if the texture is 256X256, the oject be 2.56 X 2.56 in
size. Multiple of 10. (hypotheoretical :-))
That way, I don't have to jack and jack with each object and
texture when I place them in the world.
One other thing is, I don't quite understand the UV thing..
your explaination of the orientation up there paints a less
blurry picture for me though.

A detailed tutorial on what we have discussed over the last
few days would be an enourmous help for new torquers,
I'm sure. (if you do one, be sure to cover all in detail... including
icon locations etc.)

and ya know what, as soon as I get my stuff together on this,
I'm gonna bust out a few detailed tutors myself.

On an added note, I followed directions for the UV rotation
using the axes tool. When I click on the normalize rotation tool,
it rotates the object back to it's 0 position from 90 degrees and not
just the axes.
#3
01/13/2005 (8:55 pm)
Nevermind.. got it to work.. not sure
what i did or didn't do that time
#4
01/13/2005 (9:10 pm)
Quote:On an added note, I followed directions for the UV rotation
using the axes tool. When I click on the normalize rotation tool,
it rotates the object back to it's 0 position from 90 degrees and not
just the axes.

That happens if you have the object selected and not the axis. Another thing to point out with that is that it won't affect the UV mapping in gameSpace. The thing here is that in a .map, the orientation of the object is used along with a planar projection of the texture calculated from the UV's in gS, which can leading to stretching and smearing.

But it's good that you got your texture problem solved :)
#5
01/13/2005 (9:14 pm)
Ya... definatly...
and btw, thank you very! much for your assisntance.
Your expertise is invaluable.

but... I still need a way to get the
textures aligned with the object.
Do you have any advice there?

(Like I want a picture of a wall to orient to
a wall block, say line 15X10X1 and a
256X256 texture.)
they are always offcenter a bit.. and
it is a very time consuming process getting
them aligned.

One other thing is that the texture wants to align
itself with the top of the texture at the center of the
object and not top to top. So it appears to be halved
when imported.
#6
01/13/2005 (9:40 pm)
Another question related to that:

How does the create game UV's work
and how does it affect the textures?
#7
01/14/2005 (10:10 am)
Boy is that a complicated answer... It took me a few days to understand how it did it. Here is the link to the best explanation I've found for how it maps textures. Obviously, it's completely alien compared to the rather straightforward way that "normal" modelling maps UV's. So you can see how it's easy to lose quite a bit in translation.
#8
01/14/2005 (11:18 am)
Thanks again Ted.... I just got "3D Game Programming All In One"
in the mail today... can't wait to crack it. It will more than
likely cover the issues that I have been asking about because
it deals specifically with the Torque engine.

But, I just opened "Game Scripting Mastery" by Alex Varanese
last night, and I could NOT put it down. I was up til daylilght hours
absorbing this invaluable knowledge that Alex so well distributes.

I highly recomend that one to anyone designing games because
scripting is essential to good game code.