Search Unity

A request for a object viewer project

Discussion in 'General Discussion' started by tsumea, May 4, 2010.

  1. tsumea

    tsumea

    Joined:
    May 4, 2010
    Posts:
    3
    Hi there,
    I run a website called tsumea.com which is the premier website on the Australian and New Zealand games industry. It's been around for 8 years, and it focuses on the game development side of our local games industry. I've also been a long advocate and fan of Unity 3D (I've purchased a license a while ago).

    For our many visitors and game development enthusiasts, I've been planning some quick 2D and 3D activities for them to partake and learn in. For the 3D part, the idea is to have a fortnightly assignment where we all model something covering the same theme and upload it on the site for all to see and discuss. Participants will have to use the Unity 3D indie to export their model and upload it to the site where it can be viewed via the Unity web plugin.

    Unfortunately, my Unity 3D-fu is rather weak, and I'm hoping someone here could develop and share a simple object viewing project with us (and anyone else, really), plus a straight forward tutorial to explain how participants can use it (from loading the project, importing a model, and exporting it). The object viewer doesn't need to be too snazzy, I guess it needs to auto-rotate the object upon viewing it, and some basic controls like stop rotate, rotate (x / Y axis), zoom in/out, reset position etc..

    I'm pretty sure something like this is really basic to do, but if anyone could help out, you will have my utmost gratitude! Thanks for reading. :)
     
  2. Checksum

    Checksum

    Joined:
    Apr 18, 2010
    Posts:
    19
    The first thing I asked when doing 3d model for unity was "can you give me unity's model viewer" and then it turns out unity doesn't even have one.
     
  3. amigo

    amigo

    Joined:
    Feb 20, 2010
    Posts:
    51
    You must be aware that Unity accepts some major 3D file formats directly. It's probably converting them internally but there's really no reason to have a standalone "viewer" if you can just drop a file directly into the Editor and work with it.

    Besides, all original files are stored in your Assets folder. You can go ahead and delete your Library folder - Unity will just rebuild it again from your Assets so those internal files are really "interim" format used to work on and build your creations.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, you can't...you will lose all your meta-data, rendering your scenes useless, so you'd have to rebuild them manually. Plus it will basically destroy your materials, and probably some other bad things. So don't delete your Library folder if you care about your project at all. ;)

    --Eric
     
  5. amigo

    amigo

    Joined:
    Feb 20, 2010
    Posts:
    51
    Hmm..perhaps I did not look into it enough then. :)

    I just remember that if you have saved your scenes into Scenes/ folder then everything you need is already in there (your materials, meta-data, etc) and deleting the Library/ just forced Unity to rebuild everything. But nothing seemed to have been lost.

    Maybe I'll run more tests to make sure, hehe.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Nope, deleting the Library causes the bad stuff I mentioned to happen, believe me. This is easy to test...make sure you're not running Unity, duplicate an existing project, remove the Library folder, run Unity and load the project, and then be glad it's just a duplicate since nothing works anymore....

    --Eric
     
  7. amigo

    amigo

    Joined:
    Feb 20, 2010
    Posts:
    51
    Well I'll be ... I went and tried it just now on the Car tutorial. Deleted the Library folder. Unity re-imported everything again but that's about it. The associations between items were gone...

    Lesson learned. Thanks.
     
  8. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    And to finally get this thing back on track again...

    If I am reading this correctly, he is asking for someone with Pro to build an object viewer he can place on the website and people can just upload their packages to the site and then open up the viewer and type in the package's URL on the site and voila, the viewer imports the package and displays the object.

    Dropping the source asset create by someone you don't know into your Unity project is not really possible if you don't have the source asset. This would entail everyone to, every fortnight, create 3D works for free for everyone to download and use as they see fit. This doesn't seem in line with what they are trying to do, which is making the stuff available for viewing and discussion.

    So basically, they would have an upload script that places the uploads in a standard location. Presumably the upload script will also store an XML of what week the upload belongs to. Thus the viewer in question should:
    1. Start up
    2. Read the XML file
    3. Display a list of weeks in a scrollable area
    4. When you click on a week it loads all the assets for that week via the XML urls and Unity's WWW class
    5. It then shows you a table of the available models
    6. When you click on the model it will zoom to full screen and a distance filter will be applied to the rest.
    7. You then have rotation control over the model until you click the "Back" button.

    I think that is a clear enough description of what he is after in case someone (who doesn't also have 3 projects going at once) wants to tackle it...
     
  9. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    681
    I guess Eric's modesty prevents him from directing your attention to the Object importer utility he developed and sells here: http://starscenesoftware.com/Utilities.html - although it is linked in his sig.

    He's so cool, he forgets to tell you how cool he is...:)
     
  10. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Well I for one know that I ever knew this existed :)
    Brilliant. So it seems this is exactly what the original poster wanted! Brilliant!

    Now I have a question for Eric... the exact opposite of this initial question... that runtime file browser of yours... hmmm... Got me wondering. I was curious if it were possible to download unity-in-game-content, save it and then in future load it as a normal asset instead of having to download it every time you log in... is this a very involved and complicated thing to do or is this quite easy to do?

    Edit: Sorry, forgot to add:
    Since this content might be copyright protected and under "You may not redistribute the files" restrictions this would mean that the raw source can't be saved where anybody with folder access can get to it. It would need to adhere to unity's content protection conventions. Is THAT possible? To download stuff in game, store it locally and NOT give the person who purchased it access to the raw data... (i.e. I buy a troll for exclusive use in my game. You buy the troll in game, save it, take the obj file and use it in your own games. I get sued... :p )
     
  11. hs1S

    hs1S

    Joined:
    Jul 23, 2009
    Posts:
    153
    I made something:

    http://code.google.com/p/ezextensions/source/browse/#svn/trunk/extension/modelviewer

    http://code.google.com/p/ezextensions/source/browse/#svn/trunk/unityscripts/objviewer

    Works with .obj files, it's ready to use with ez publish: http://ez.no - http://projects.ez.no/modelviewer - just attach these two scripts to camera, you may give a look at http://code.google.com/p/ezextensio...sign/standard/override/templates/full/obj.tpl to see how communication is made between unity and javascript, because the file path to the .obj and the texture file is specified in html.

    You can found the original script here: http://forum.unity3d.com/viewtopic.php?t=45990

    How it works: http://www.youtube.com/watch?v=c3xFE3NvkNk

    It needs some better controls, because mouse scroll button makes web page scrolls down.

    My oringinal post on show case: http://forum.unity3d.com/viewtopic.php?t=58828

    It's open source and reuses a script posted here in the foruns, I think if you know what you are doing in your web site, you can adapt it in matter of minutes.

    The problem using unity web player in a big site is that it will crash your user browsers sometimes, it still a beta tech.