Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 1
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 3488 times and has 0 replies Next Thread
hansmex
Advanced Member
Member's Avatar

Netherlands
Joined: Sep 26, 2009
Post Count: 3950
Status: Offline
Reply to this Post  Reply with Quote 
Applying a texture in an OBJ file

Ladies and gentlemen,

While playing around with the one-sided box, I decided to try and make a box where textures will be correctly aligned on all visible faces.

Using the one-sided box as a template, I made several "new" boxes with 6 separate faces, trying to manipulate the way textures are applied. However, every time I import the OBJ in SH3D, the textures are applied the same way.

After comparing several OBJ files, I found that the difference with a standard box and a textured box lies in the "vt" and "f v/vt/vn" values.
- In a standard box the "vt" value is omitted because there is no texture, so the we get "f v//vn".
- In a textured box the "vt" value is specified twice and in different ways. Once separately as "vt" and once within the "f" value "f v/vt/vn".

From the data in the OBJ file with texture, I can clearly see that the separate "vt" statement is connected to the size of the texture relative to the size of the object. Does this statement have a second function?

A box with 6 faces (defined in a slightly different way as the standard SH3D box) gives these values when a texture is applied:
f...1/1/1...2/2/1...3/3/1
f...1/1/1...3/3/1...4/4/1

A standard SH3D box gives slightly different values when a texture is applied:
f...1/1/1...2/2/1...3/3/1
f...4/4/1...1/1/1...3/3/1

(Dots entered for clarity, as the forum software doesn't allow multiple spaces.)

Is this difference significant? In both cases the textures are applied correctly only on 3 of the visible sides.

The main questions, then, are:
- Which value(s) should be changed when designing a 6-faced cube in order to change the way textures are oriented on a specific face?
- Can this be defined in an OBJ file in such a way that a general purpose box is defined to which users can apply (in SH3D!) a texture that will always be oriented in the same way on 4 faces of the box?

I hope I explain myself clearly.

Hans
----------------------------------------
Hans

new website - under constuction
hansdirkse.info
[Oct 11, 2010, 4:49:14 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved