Windows Question regarding Wavefront.obj files

NickKall

Member
Hi Everyone,

I am trying to make a 3d modelling program. Picture below...

...Tried to upload a photo but the website wouldn't let me...

I have been using Model Creator for some time. Thought I could try making one for myself. I want to make it so you can use multiple textures.

I have done a gamemaker model export. I would like to be able to export to .obj format. After all my reading, I can find a clear description regarding the materials.

Here is where I think I have to go.

1. Save the textures into the same directory as the model file as .mtl files.
for example: texture1.mtl and texture2.mtl
2. Here is where I get into trouble. Is this how I would reference the textures in the .obj file
Code:
mtlib texture1.mtl
mtlib texture2.mtl

v 1 1 0
v 1 2 0
v 2 2 0
vt 0 0
vt 1 0
vt 1 1
usemtl texture1
f 1/1 2/2 3/3

v 1 1 0
v 1 1 0
v 2 2 0
vt 0 0
vt 0 1
vt 1 1
usemtl texture2
f 4/4 5/5 6/6
Now. Here are my questions.

Will this .obj file get texture1 for the first triangle and texture2 for the second?
Is the mtlib business at the top needed there or should I make a seperate text file for the textures or mtlib?
When do I use newmtl commands?

Bonus questions:
Can the textures repeat? ie Can the u and v values be 24 and -16?
On the textures, is 0,0 on the top left or the bottom left?

Thank you for reading and look forward to reading your responses.

Nick
 
Top