Search Unity

Using Unity to Build a 3D Model Viewer

Discussion in 'Getting Started' started by ashwinjaishanker, Jan 26, 2016.

  1. ashwinjaishanker

    ashwinjaishanker

    Joined:
    Jan 20, 2016
    Posts:
    2
    Hello,

    I'm just getting started with Unity and I thought it would be neat to build a simple FBX model viewer in Unity. All I really want to do is just load an FBX file at runtime, and be able to perform simple operations on it like rotation, panning, zooming etc.

    I assumed this would be simple to do and I'd find a ton of tutorials explaining the same but obsessive googling has only yielded this:


    I also found this thread on the Unity forum: http://forum.unity3d.com/threads/a-request-for-a-object-viewer-project.48060/

    Unfortunately, both links above are 4-5 years old. Does anyone here know of any recent resources/sample projects/turorials that will give me a head start?

    Thanks a lot for the help!
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    2,889
    Welcome!

    Did you try going through those guides anyway, despite their age? Regardless of any differences between versions, the concepts are still likely solid, and all that would really need done would be to update the code to fit the latest API, which can be handled with Googling on a case-by-case basis. It's rare that there are tutorials to cover exactly what you want to do in the latest piece of software, so you have to be able to adapt and learn from older content as it's available.
     
  3. ashwinjaishanker

    ashwinjaishanker

    Joined:
    Jan 20, 2016
    Posts:
    2
    Yes, that's what I'm doing currently. Since there isn't a recent tutorial, I'll try to post one myself once I'm done with it.

    Thanks for the reply!
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,334
    You won't find a lot of tutorials because this is not simple to do. Unity's FBX importer serves the editor, not the runtime.

    For runtime model loading, the easiest is to use OBJ, with something like ObjReader. (That's what we do for mod support in High Frontier.)
     
  5. Honorsoft

    Honorsoft

    Joined:
    Oct 31, 2016
    Posts:
    50
    It's 2018, and I only found one free 3D model viewer made with Unity. I use Blender, Autodesk FBX, and 3D Converter 5.x to view my models now, but Blender and Autodesk are too slow for frequent model browsing, and 3D Converter lacks basic features like panning the view camera so you can still see the model when you zoom in.
    Anyways, I want a 3D model viewer that is quick, and let's me preview models without having to import them into my Unity project, or having to use slow loading or overly complicated 3D software. I haven't found any free 3D viewers on the Asset Store (the two I found were removed for some reason), so it looks like I will have to make my own once I learn more about loading 3D models at runtime in Unity. I am also going to make a 3D model viewer for Android using Unity, if I don't find one someone else made.
    Here's a 3D model-viewer made with Unity I found (I haven't tried it yet) for anyone still looking for one:

    The ViewerWin project files:
    http://www.mediafire.com/file/xp2euprfzbf2adp/Viewer+Project+Files.zip

    The ViewerWin built-executable:
    http://www.mediafire.com/file/rqwkcpin9uc88ak/ViewerWin.zip
     
    Rogerjak and kienbb like this.
  6. Rogerjak

    Rogerjak

    Joined:
    May 13, 2019
    Posts:
    1
    Thanks for the links, will see if I can use them. Did you end up doing the 3D viewer you were talking about?
     
  7. Honorsoft

    Honorsoft

    Joined:
    Oct 31, 2016
    Posts:
    50
    Not yet, I took a break for a while but I have more interest in either making a modding system for Unity which could be used for adding content to a Unity application or game, without using precompiled asset packs. That would include 3D model loader and viewer code, and likely need code to import an FBX and texture it from code.