• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

3D Model Viewer

Level 29
Joined
Jul 29, 2007
Messages
5,174
I noticed an issue with ribbons, easily noticeable on my model, Lord Nemesis.

That's because you used the wrong interpolation type for the visibility.
If it works in-game, it just means this is yet another instance where the game doesn't follow its own format.
I don't want to force interpolation types without knowing the exact rules, so if you want it to work, change your type to None.

/Edit
Added the option to hide/show geosets, and to hide/show emitters.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Added the option to disable textures.
When disabled, every texture is white.
For SC2 models, only the diffuse and the emissive textures are disabled.

/Edit
Finally fixed all the scaling issues when parenting models to SC2 models with scale animations.
The Zerg are awaiting your abuse.

I also removed the option to show or hide textures, and instead added a white shader which affects both MDX and M3 models.
The normals and texture coordinate shaders now also affect MDX models.
 

Attachments

  • Zerglings.png
    Zerglings.png
    656.6 KB · Views: 99
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Fixed all of the issues I know about.
  • The workings of M3 models are now properly hidden from the user, so it isn't scaled by 100 and rotated as far as the user knows.
  • Scene saving/loading works again.
  • Particle emitters are now scaled properly together with model instances.
  • Tons of small fixes.

The rotations were changed to work with degrees, however they are kind of weird and don't exactly work as expected, I'll probably change them in some way in the future.

Resources can now be removed from the viewer, but I am not sure if I'll bother to add UI for it.

I also added an extending API that allows to quite easily create new model and texture formats that the viewer can use (the github contains simple examples of OBJ models and BMP textures).
This effectively makes this viewer a generic model viewer, assuming one can write format handlers.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
I made a small demo for a possible new version of the viewer's client.
Would a better version of this interest people?
By better, I mean including a search function, much like the model's section search function, and improving the automatic preview image generation.

Hints for current usage:
- Press on a preview image to load it.
- To exit, either click outside of the viewer, or press Esc.
- The Left/Top arrow keys cycle to the previous animation, and the Right/Bottom arrow keys cycle to the next animation.
- Mouse controls work the same way as they currently do.

On a side note, it says it finished loading but stays black because it only cares if the model loaded, but the textures load later on. This can be taken care of.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
You can't do that directly, because there's a maximum for WebGL contexts available by the browser (since having many of them will hurt performance), however the canvas element can be injected instead of the preview that the mouse is on.
In reality, though, that might mean downloading huge amounts resources (e.g. on the range of 10MB for a small search result) when just browsing around, I am not sure how user friendly or server friendly that is.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
When it's only on hover, can't we just re-use the context by clearing it, moving it to a different parent DOM node and then display the new model?

Yes, that's basically what I said, but you need to be clear on what happens when you hover.
Does it load the model, or are all the models loaded, and on hover you see the animation?
If the former, there isn't really any big different to what happens now. If the latter, you'd end up downloading a lot of data.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok, started generating GIFs.
From what I can tell so far, it will take a couple of hours (although the browser seems to get slower and slower, I am not sure why), and every GIF should be in the range of 20-300KB, depending on the length of the animation.
This is while skipping every other frame, since that reduces size by a half (duh), and it still looks ok.

On a side note, made the search function and loading-images-on-scroll a whole lot more efficient, they should not lag anymore.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Hours for all of the WC3 MPQs (2089 models?). I stopped it after a couple of hours and it was about 50% done.

I am going to make it smarter and completely ignore things with no actual animation (for example, it wasted a huge amount of time on terrain objects, when they don't even animate), and also select the proper stand animation (it sometimes selected "stand work" and the like, which tend to be much longer. E.g. the human lumber mill produced a 4MB GIF!).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok, I am not going to put GIFs. They take too much bandwidth while offering terrible quality once they are upscaled (and then there's also the matter of generating them - PNGs take 2:30 minutes, GIFs take many hours).

On a side note, moved to JPGs instead of PNGs. Higher resolution (no more silly blurriness), and less bandwidth.

Changed the searches to be weighted.
This means that the closest a term was matched to the file name itself, the more it affects the search.
For example: "Units/Human/Footman/Footman.mdx". It can be said that "Footman" is much more important here than "Human" and even more so than "Units", so if the search is "units footman" - this model will get a big weight, much more than other units that are not the footman, and probably be relatively at the beginning of the result list.
This tends to make the search results a lot more intuitive.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
So, after a very long time of generating hundreds of megabytes of images, I can say the following: both GIFs and WebPs are out of the picture.
WebMs on the other hand might be ok. At 210x210 pixels with skipping two frames, most of them are about 2-50KB, bigger ones are about 60-80KB, and then there are stupidly big ones that I wont ever include either way (120-1256KB).

Generating the WebMs themselves doesn't take too long with ffmpeg. Generating the source images for them (every frame of animation as a separate image) however takes hours, and produces 86617 images (while skipping models with no animations).
That being said, if I immediately skip models with animations longer than some threshold, it should take far less time.

Added the WebMs, though there is no indicator of whether they loaded or not.
Changed everything to 192x192 pixels.
On a side note, WebMs also don't have all the artifacts that the GIFs had (e.g. messing up the red team color).
 
Last edited:
Level 48
Joined
Apr 18, 2008
Messages
8,421
I'm assuming the other .MPQs aren't hooked up yet? I cannot find the Shadow Hunter, Beastmaster or any of the Naga units.

By the way, if at all possible, the Portrait models should be hooked up to their cameras in the preview. As it stands some of them are simply invisible because the portrait model is not centered on the axis. It would look better in general as well. Another idea you might consider is adding a checkbox for "View Portraits", because many times you wouldn't really want to sift through lots of portrait files.
Also, I really hope the old features of changing cameras, the skybox, teamcolor, etc will eventually be put back in.

Oh, and something I personally found amusing. Because of the Sorceress's path (Units\Human\Sorceress\Sorceress), she is one of the first results when searching for "Orc". :p
Perhaps give individual words keywords higher importance than keywords which are a part of another word ("Orc" vs "Orca"\"Sorceress")?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Oh, I didn't notice I didn't have all of the models (missed 1175 models).

The cameras are a good idea.

You can't really define what is a "word", so there's not much to do there.
Sure, you could define a word as something that starts with a capital letter, but I am sure there are models that aren't named like that, both in the MPQs, and obviously in the Hive's model section.
 
Last edited:
Level 48
Joined
Apr 18, 2008
Messages
8,421
Can't you separate them? For example:

Units\Orc\Grunt\Grunt.mdx - Units, Orc and Grunt would be separate 'words'.

Units\Human\Sorceress\Sorceress.mdx - Units, Human and Sorceress would be separate 'words'.

Searching for "Orc" would still bring up Sorceress, but she'll be lower than "Units\Orc\Grunt\Grunt.mdx" and much lower than "Units\Orc\ChaosSpaceOrc\ChaosSpaceOrc.mdx".

Actually, thinking about this, I'm not even sure if that would work or if it's even a good idea... The point is that Units\Orc would take precedence over Sorceress, basically.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Changed the order of precedence to what you suggested, while also doubling the weight for full matches (e.g. "units" is worth more than "unit" for "Units/.../.../....mdx").
Going to change the way searching works (though the above is how it works right now).
Every model will have a list of tags ("human", "unit", "hero"), and they will be matched against the search terms, in addition to the model name itself (not the path, but the name of the mdx file).
This will be consistent with how the data of custom Hive models is stored.
A side effect is that the MPQ data file is now "huge" (400KB), however when gzipped it's less than one of those pesky WebMs (39KB), so yeah...

Regarding WebM videos, I don't like them too much. <video> takes a lot more time to create and insert to the document than <img>, increasing the time of searches quite a lot (relatively speaking).
It's also pretty hard to properly decide what models actually animate or not, because MDX supports bugs...
I don't think I'll keep them, or at least have them as an optional feature off by default. The drawbacks are quite big, just for a short animation.


Removed the WebM videos, the page is so much more responsive without them...

Anyway, changed the search format. I removed the explicit filtering for now.
When the page is first opened, there is a list of all the available tags.
The search still uses weighting - tags weigh more than a name, however if the full name was matched it will weigh a lot (e.g. "knigh" will weigh 1 for knight.mdx, but "knight" will weigh 10).
If the name of the model author was matched, it too adds a very big weight. This will be used for the Hive's custom models.
Currently I just added manually the DC models, still waiting on some automated process to get all of them (and JPGs for them).
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
About the WebM videos. I wasn't expecting every single image to be a WebM movie. The image would be replaced as soon as you hovered it, so there would always be only a single movie.

That would require to wait for each download, which might or might not be ok, depending on the ping (or patience), however I can add that, since it will remove my issues with videos.

http://prntscr.com/5yf53g It seems this new viewer cannot handle German. :p
(it's supposed to say 'Über')

Also, some of the red\yellow particles are green for some reason. Look at the Torch doodad and my Elite Siege Tank's Attack animation for example. Any idea what might be going on there?

Yes, I saw the encoding issue.

Many of the WC3 particles are messed up, if you'll look around. I probably ruined something in the MDX handler at some point without noticing, I'll fix it at some point...
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Fixed the MDX particle colors.

Added the ability to ignore tags/names, when a minus is written before a search term.
E.g. "units -human" will get all of the units, except for human ones, "-ingame" will get every custom model, and so on.
Since it works on names too, things like "-foot" will ignore every model with "foot" in it's name, such as Footman.

And made many changes behind the scene to the library, but who cares about that, right?

Added all of the Hive's database to the search (no screenshots yet).
Also added support for quoted terms, to allow to search for user names with spaces.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
For the simple mode, I believe that giving control over the animation, and automatically changing the camera to match that of the model if it has one (mostly portraits) is enough.

Any suggestions on how to design the advanced mode, so this time it wont look so messy?
Take into consideration that the camera is much more powerful now, and you can freely set its location, target, project camera/screen coordinates, and so on.
That is, you can, for example, move a model on the X/Y plane by moving your mouse, or move it freely relative to the camera (much like you'd do in a 3D modeling software).
I really want it to be much more keyboard/mouse based instead of UI based, because UI clutters everything.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
So, since I received exactly 0 feedback, I kept it as-is with no UI, and added a link to the old viewer, if you want to use it.

Added thumbnails for most of the custom models, and fixed all sorts of bugs in the MDX handler.

This is now officially the public viewer.
 
Terrible idea with the search thing. Also, when I click on a model and go to View it in 3D, it opens a search for models inside the viewer. Illogical since I already selected a model from website's search rather than viewers one.

The search system in viewer is highly annoying since it only contains images. I can't tell if I want to view that model from just an image. It would be better if it would also have a name of the model.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Terrible idea with the search thing. Also, when I click on a model and go to View it in 3D, it opens a search for models inside the viewer. Illogical since I already selected a model from website's search rather than viewers one.

The search system in viewer is highly annoying since it only contains images. I can't tell if I want to view that model from just an image. It would be better if it would also have a name of the model.

Does it not instantly open the viewer itself above the search? (because as far as I can see, that properly happens in Firefox, Chrome, and IE).

About the gallery - if you hover over an image, it shows the name.

If something isn't intuitive (like the search itself), you are free to comment here.
For the hundredth time, I am not a designer. If you have a better design, do tell.
 
Does it not instantly open the viewer itself above the search? (because as far as I can see, that properly happens in Firefox, Chrome, and IE).

About the gallery - if you hover over an image, it shows the name.

If something isn't intuitive (like the search itself), you are free to comment here.
For the hundredth time, I am not a designer. If you have a better design, do tell.

It's not about the design. It's about the whole search system inside model viewer, it's stupid. And no one would even use that thing over the comfortable one in Hive resource section.

I liked it better when you clicked on a model resource and clicked the option to "View in 3D" and it automatically viewed the resource model in 3D, without any useless crap.
 
Top