Importing OBJ from sketchup

Started by IZACIZAC, June 25, 2013, 05:38:23 AM

Previous topic - Next topic

IZACIZAC

Has anyone succesfully imported OBJ files from sketchup, if so, how?

My model (block) is initially completed gray, I think its a problem with the MTL file, I'm seeing

map_Kd block_Textures/Concrete_Aggregate_Smoke.PNG

block_Textures is a folder sketchup created, that I deleted as I load them from some other place. My textures are added to the texturemanager just as the png name, so

Texture named Concrete_Aggregate_Smoke.PNG added to TextureManager!

So I changed the line in the MTL file to

map_Kd Concrete_Aggregate_Smoke.PNG

But still its just grey. If I delete that line entirely though its draw in one solid colour, roughly the right colour but not a texture

The OBJ file contains

mtllib block.mtl

and

usemtl Concrete_Aggregate_Smoke

Anyone know what I am doing wrong?




EgonOlsen

jPCT loads the texture information but not the texture itself. You have to load some texture and assign it to the TextureManager with exactly the name that you have in your mtl file before loading the actual object. If you don't do that, jPCT creates a white default texture with that name that can be replaced later.

More information: http://www.jpct.net/wiki/index.php/Loading_models

IZACIZAC

#2
I am adding the texture to the manager with the exact same name, its just the models from sketchup that I cant get to display textured.  As a test I downloaded a bunch of free 3ds and obj textured models which all work with my code.

IZACIZAC

Nevermind I had inadvertently deleted .PNG from the names I added to the texture manager.. ignore me from now on ^^, thanks anyway