obj file loader

This forum is currently in read-only mode.
From the Asset Store
Source File, music and art pack for Android Negotiator
  • http://img189.imageshack.us/img189/5131/tempxk.th.jpg]

    Here is a .obj file loader. It will load obj files with UV coordinates exported by Blender, but it will only read lines that start with v, vt or f. It uses a 128x128 texture, but if you use another it will need to be flipped vertically.

    Usage is pretty straight forward. Select a file to load. Press the "load" button then the "prime" button, and viola!

    obj loader cap:

    EDIT: http://dl.dropbox.com/u/5426011/examples%209/fileload94.zip

    blender exported obj file (texture already in cap):

    http://www.filedropper.com/bear

    It serves as a nice benchmark for Construct. I get about 25 fps with the bear.obj file. What do you get?

    On a side note I notice construct is able to add files to a cap through the project bar. It would be a useful feature if the added files were accessible at runtime, but there seems to be no way to access them.

  • thats insanely cool, but its pretty slow? the model doesn't seem very high poly at all but its running at 35 fps, and ive gotten 300+ on models with alot more "polygons", but i used only maybe 5-10 distort maps on those models, and wrapped them up in a special way since i didn't need to fit into any real 3d format.

    from looking at your code im assuming your using a sprite as a quad for every face of the model? is that the cause or is it something else?

  • Yeah I'm using a quad for every face, both three and four sided. Your method with distort maps with more control points is probably faster. I'm running into a slowdown associated with a high object count. Also if you look at the last event it only needs to be active when the point locations change. That loop when disabled almost triples my frame rate.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Congrats, that's quite a feat.

    I figured the first loader would have been in Python, didn't even imagine text manipulator could have done it.

  • HOLY CRAP THAT'S EFFING CRAZY

  • BLENDER INTEGRATION ASFOHAIDVHDOCKSD

    *dies*

  • And suddenly, a new contender emerges.

    Very cool man, and more efficient than my own obj loader by a pretty decent margin (I think, can't check using my own computer at the moment).

    3500~ faces at 35 fps is pretty impressive knowing how unsuited Construct is for 3D.

  • well construct can do 3d, but not in this sense, you have to scale back and using a sprite for each quad is seriously gonna cause some slowdown. i actually have a 3D game running WITH collision detection and a bunch of pretty smooth models, rudimentary shading and other stuff working along side the 3d engine, and basically no load time since models are created using loops and beziers and fancy tricks. and i get 120-145 fps.

    Construct wont be able to actually use real meshes, loaded externally at an acceptable frame rate until a mesh object is created, using built in direct 3D stuff, which ive heard rumors about btw ;P

  • well construct can do 3d, but not in this sense, you have to scale back and using a sprite for each quad is seriously gonna cause some slowdown.

    Scaling back is a given.

    I disagree that using 1x1 distorted sprites as quads is less efficient than using 'meshes'; in all of my testing, meshes yeild noticably lower FPS.

    I hope that rumour about proper mesh support holds true. Would makes things much easier in the future .

  • well i cant say for sure anything about the mesh stuff cause i haven't tested it, or haven't tried it, but i know that when i wrap a 20x20 mesh onto a sphere, it runs pretty damn fast even in a cap with other models, but i dont think having the 400? quads (im kind of tired and im not sure if my are of the mesh equates to number of quads) would be faster would it? it seems it would take up way more memory, and be a lot bulkier to handle, but like i said, ive only tried the mesh way of doing things, and im basing it on the good performance i got with it, not to mention i dont know how youre handling face wrapping, and that could very well be a contributing factor.

    anyways, i think anyones that dabbled with making models knows just how unsuited construct is to it.

    a mesh object would make it so much easier and better performing anyways

  • Construct wont be able to actually use real meshes, loaded externally at an acceptable frame rate until a mesh object is created, using built in direct 3D stuff, which ive heard rumors about btw ;P

    I would like to hear these rumors please

  • Except in application appeared clicking "cancel"

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)