Fabrice ,thanks for reply , I found the issue and posted it here some hour
ago . It has to do with the exported structure of mtl from Max . It is
really stupid bug .
Here is the post:
Finaly pinned down the problem for the .obj textures autoloading issue .
Started to comapre the mtl output from Max and PreFab . You won't believe
guys how simple is the solution !!!!
Appears that the exported from Max mtl looks like this:
newmtl my_text
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5880 0.5880 0.5880
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka myText.jpg /////////////here must change to realtive path
map_Kd myText.jpg /////////////here must change to realtive path
and from PreFab it comes out like this:
newmtl awmat_0
Kd 1 1 1
Ka 0.2 0.2 0.2
Ks 0.2 0.2 0.2
Ns 128
Tr 1
D 1
map_Ka myText.jpg /////////////here must change to realtive path
map_Kd myText.jpg /////////////here must change to realtive path
NOW , you sure think that it is a problem of the difference between tags or
numerical representation . Nope! That what I was thinking . But after trying
to exclude or format different parts in order for them to look like the
Prefab mtl , I found it : look at the position of map_Ka and map_Kd in both
examples ! in Prefab there is no space between the left margin and the
string but in the Max it is aligned with all the parameters . If you delete
that space and align the strings to the left so it is aligned with newmtl
my_text you are done . It works!
Can't believe wasted some 4 hours to figure it out.
On Fri, May 14, 2010 at 8:10 PM, Fabrice3D <[email protected]> wrote:
> to load the texture the obj parser does
> url to obj/ (- filename.obj) + mtladress passed in obj+"/"+ mtl texture
> path
> if you drop in prefab, does it works? if not what does the loading log
> says?
>
> Fabrice
>
> On May 14, 2010, at 4:14 PM, Michael Iv wrote:
>
> Yeah , now I can see that by default when laoding .obj its texture doesn't
> load . Put the image file in the same folder ,and even tried to set relative
> path inside mtl. Nothing changes .
>
> --
> Michael Ivanov ,Programmer
> Neurotech Solutions Ltd.
> Flex|Air |3D|Unity|
> www.neurotechresearch.com
> Tel:054-4962254
> [email protected]
> [email protected]
>
>
>
--
Michael Ivanov ,Programmer
Neurotech Solutions Ltd.
Flex|Air |3D|Unity|
www.neurotechresearch.com
Tel:054-4962254
[email protected]
[email protected]