Jump to content


Photo

How To Import An Obj In To Game Maker 3d


  • Please log in to reply
11 replies to this topic

#1 metrogdor22

metrogdor22

    GMC Member

  • New Member
  • 246 posts

Posted 08 January 2010 - 11:07 PM

Im making a 3D RPG, and i have a few models that i whipped up in Google SketchUp, and then exported them to OBJs. now i need to import these models in to Game Maker(8 Registered). ive seen this done before, but i dont know how to do it. if someone has a script or extension to do this, please help me.
  • 0

#2 Chaos_Zero

Chaos_Zero

    GMC Member

  • New Member
  • 111 posts

Posted 08 January 2010 - 11:51 PM

Try this - http://gmc.yoyogames...howtopic=246230

Fastest GML script for loading a .obj file I think.
  • 0

#3 metrogdor22

metrogdor22

    GMC Member

  • New Member
  • 246 posts

Posted 09 January 2010 - 02:07 AM

Try this - http://gmc.yoyogames...howtopic=246230

Fastest GML script for loading a .obj file I think.


i tried that, but all that came out was the white block(this is intentional, its what im using as the player for now) and a black blob(not intentional)
  • 0

#4 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 09 January 2010 - 11:50 AM

i tried that, but all that came out was the white block(this is intentional, its what im using as the player for now) and a black blob(not intentional)

Maybe that is the information thats currently stored in that .OBJ-file (two .OBJ files ?).

As the script has been used for over 3 years without anyone having (serious) problems that stemmed from it I must assume that the problem is either in your .OBJ model-files (no texture-coordinates perhaps ?)or in the way you are putting/drawing them into the room (used texture, blending, lighting, fog) , ....

With the absence of any real info (model-file, used code) I'm afraid that all we can currently do is to make some vague guesses.
  • 0

#5 metrogdor22

metrogdor22

    GMC Member

  • New Member
  • 246 posts

Posted 09 January 2010 - 05:29 PM

ive heard about texture coordinates, but i didnt think they were important. i made the model in google sketchup, then exported it as an OBJ. that help any? i used the script exactly like the example says.
  • 0

#6 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 09 January 2010 - 05:54 PM

ive heard about texture coordinates, but i didnt think they were important.

They are, very. They tell the texture which pixel of it should be placed on which vertex (model-coordinate). If all the texture-coordinate pairs would be the same it would stretch a single pixel all over the mode l (giving it a single color, just as you have now)

i made the model in google sketchup, then exported it as an OBJ. that help any?

No.

Look into the .OBJ model-file and se if you can find any lines starting with "vt " (Vertex Texture coordinate). If not than the (conversion to a) model-file is to blame.

i used the script exactly like the example says.

"Garbage in, garbage out"

Or, to say it otherwise : If the input is incorrect you won't ever get a correct result. :P

Hope that helps.
  • 0

#7 metrogdor22

metrogdor22

    GMC Member

  • New Member
  • 246 posts

Posted 09 January 2010 - 07:12 PM

ive heard about texture coordinates, but i didnt think they were important.

They are, very. They tell the texture which pixel of it should be placed on which vertex (model-coordinate). If all the texture-coordinate pairs would be the same it would stretch a single pixel all over the mode l (giving it a single color, just as you have now)

i made the model in google sketchup, then exported it as an OBJ. that help any?

No.

Look into the .OBJ model-file and se if you can find any lines starting with "vt " (Vertex Texture coordinate). If not than the (conversion to a) model-file is to blame.

i used the script exactly like the example says.

"Garbage in, garbage out"

Or, to say it otherwise : If the input is incorrect you won't ever get a correct result. :P

Hope that helps.


thanks, i looked into the OBJ file, and nowhere does it say "vt", so, according to u, it is the fault of the conversion. do u know of any other free modelling programs i could use, possibly any that save or export the model as *.gmmod(i think thats it, the model file type that game maker reads)?
  • 0

#8 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 09 January 2010 - 07:44 PM

thanks, i looked into the OBJ file, and nowhere does it say "vt", so, according to u, it is the fault of the conversion.

Either that, or the model had no texture to begin with. ;)

do u know of any other free modelling programs i could use, possibly any that save or export the model as *.gmmod(i think thats it, the model file type that game maker reads)?

I first would do some googeling on Google SketchUp and how to export textured objects from it. Maybe its just a setting you need to adjust.

If not you could take a look at a gazillion of model-editors, as most can export to .OBJ (which can be read by GM using that script you allready have. From there you can either use it directly, or save it in GMs own format).

I allso suggest you take a look at the "3D tools" sticky-topic at the top of this subforums main page, which contains references to all kind of tools, including 3D editors.

Hope that helps.

[edit]
Spelling ...

Edited by ragarnak, 10 January 2010 - 11:40 AM.

  • 0

#9 Symbols

Symbols

    GMC Member

  • New Member
  • 343 posts

Posted 10 January 2010 - 03:15 AM

my obj convertor (normals not yet supported)
please read instructions supplied after/whilst testing

http://www.mediafire...php?wmtgxmttjyn

You can modify this in anyway you like to suit your game.

Thanks.

Edited by Symbols, 10 January 2010 - 03:27 AM.

  • 0

#10 metrogdor22

metrogdor22

    GMC Member

  • New Member
  • 246 posts

Posted 10 January 2010 - 03:23 AM

alright, thanks for the help guys. i got my model loaded in to the game,but it's sideways. this should be pretty easy to fix after i play around with it a little. but now i have a new problem. when i give an object a texture, i get the effect of like the object picks a spot on the texture, then stretches it over the object. any help here?
  • 0

#11 PsichiX

PsichiX

    GMC Member

  • GMC Member
  • 399 posts
  • Version:GM:Studio

Posted 10 January 2010 - 03:26 AM

http://gmc.yoyogames...howtopic=377658
WaveFront OBJ loader, supported multi texturing
  • 0

#12 Symbols

Symbols

    GMC Member

  • New Member
  • 343 posts

Posted 10 January 2010 - 03:29 AM

Sounds like dodgy texture co-ordinates, when you outpuit your .obj file, make sire you got it set to 3digits or maybe even 4, and have the texture-coords box checked.

I use 3d max so im assuming you will see something similar when exporting your models.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users