• 🏆 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
You can manually click on the instance names in the Instances tab and it opens their respective menu, as always.

Fixed the mouse picking.
Picking with the mouse will now change to the Instances tab if it wasn't already active, and will scroll to the selected instance when needed (e.g. the window is small, or you just have many instances).

Changed the 3D math code to the excellent glMatrix. That, together with the fact that I removed almost all of the heap allocations at run-time (= less work for the garbage collector), and some special 3D math functions I wrote, make the viewer much faster in regards to updating models (mostly skeletons and the instance hierarchy).
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Did some more optimizations regarding speed and memory.

I am pretty much fed up with the viewer for now, so I released the current state as version 2.1 and I wont continue working on it for the time being.
This means I wont add new features or optimize it further.

That being said, if you have a bug to report, feel free to do so and I'll fix it.

Time to move on with my life...
 
Level 49
Joined
Apr 18, 2008
Messages
8,421
I can't seem to view any models. It just never loads.

And by the way, the whole thing with "instances" is not obvious at all. I still don't know how to operate that menu, what an "instance" is or how to add new instances. And people who haven't read the threat probably don't realize what they need to do to actually view the animations.
I suggest either remaking the UI or making it so that the viewer defaults to selecting the first instance loaded. Or something.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I can make it so that it selects the first visible instance I guess.

Instances are basically light weight duplicates of models, which is why you can have multiple instances (hence the name) of the same model without loading it multiple times.

Whenever you load a model (e.g. via the Resources tab) an instance is automatically created for it, but you can also create more instances from loaded models via the instances tab (the Add button and the selection next to it).

If you have a better idea for a user interface do tell, I said from the very beginning I am no graphical designer.

About your issue, write if there are any errors in your console (F12). The viewer works for me.

--

Added a very simple TGA decoder that knows how to load the very basic 32bit BGRA images used by WC3. I don't know what kind of TGAs SC2 uses.

Whenever a new instance is loaded, if it is visible, it will be automatically selected.
 
Last edited:
Level 49
Joined
Apr 18, 2008
Messages
8,421
Alright, well, it seems to work now. It may be that I simply haven't waited long enough.
I think it would be nice if you added a loading bar, to the top or bottom of the window, describing what exactly is loading. As for UI, well, for one, the loading bar could use the WC3 loading bar. You should use Hive Workshop colors for the text and UI background, including the buttons, and you should rename "Sequence" to "Animation". Also, you should group Location, Rotation, Scale, Parent and the textures to an "Advanced" button under the "Instances" tab to reduce clutter, and perhaps somehow make it more obvious how to load resources and such. What do I have to type to load a resource? The model ID from the Hive? The link to the model? The path in the WC3 MPQs? It would be nice if you could somehow hand-pick models and textures from the Hive\WC3 MPQs, by loading a separate menu\list with a Search function, but that may be too difficult to implement, I suppose. Not that I know much about it.

Also, using the Hive\WC3 themes in your UI won't hurt. The Instances\Resources\etc buttons in particular are bugging me.
Oh, and finally, I think maybe making a much bigger "World" plane might be nice, not to mention changing the "None" background color to something more neutral, such as the Magos gray(http://prntscr.com/3ho0ja) or the Hive dark gray(which I'm personally using in Magos: http://prntscr.com/3ho0o1).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You can already see what is loading and its status in the Resources tab. I am not going to change the loading bar style, mostly because changing its style is hardly supported in any way by the current browsers.

I might do the Advanced thing.

What do you mean using the Hive's theme? The background is the WC3 theme's background. The different rows have alternating colors that again, match different backgrounds in the hive, to make it more obvious where one thing ends and the other starts.

As to loading resources, the string there could be a thread ID (the number part of the url when you look at a model/texture/SC2 resource), a path to anything in the MPQs of WC3 and SC2, or a direct link to something on the hive (e.g. thread attachments, something in your pastebin).
How would you write this?

As to a texture/model list, a list like that would probably be very big and will incur a loading time penalty, but you can ask Ralle to make such a list and see how big it gets.

If you want a more Hive-ish style, you are welcome to make fitting images.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Changed the UI.
It should work properly in IE11 now (if anyone uses that).
Changed around the names and groupings, and added lots of text in the About tab.

You might need to hard refresh, because I changed some style-related things, and for some reason browsers really don't like to actually check if their cached versions of stylesheets need to be updated.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
That's not the issue, it's the fact that it needs to support multiple models.
It's a per-model setting that affects the whole scene.

You can use the arrows if the animation selection is focused, but you need to press enter for the selection to actually send an event. Not sure if I can do anything about that.

Can you link to a model with wrong particle colors?
 
Level 49
Joined
Apr 18, 2008
Messages
8,421
About cameras, think of a neat way to add them to the UI, and I might do it.

Just the same way you added animations, I would think? No need for anything more fancy than that.

EDIT: Oh yeah, what Vermillion said actually bothers me too... If you could use the arrow keys to scroll through the dropdown menus(or at least the Animations one), that would be absolutely incredible.
EDIT 2: Aha. It feels a bit buggy, but it seems to be working, I suppose. Still, if you could somehow make it more like Magos - e.g, you just need to select an animation for the Animations menu to be active\blue, that would be wonderful.

EDIT 3:

That's not the issue, it's the fact that it needs to support multiple models.
It's a per-model setting that affects the whole scene.

You can have it per-model, but only allow for one to be active at a time. Cameras are meant to be used for only one model anyhow, and I doubt a great deal of people set up scenes and whatnot. I mean, I'm gonna be honest, I think most people simply use the viewer to view one specific model at a time, or, at most, give it various attachments for testing.

EDIT 4: One final thing - being able to change the texture of the ground, at least between a few presets(Barrens, Lordaeron Summer, Lordaeron Winter\Northrend\Icecrown, Ashenvale, Sunken Ruins and Outland would be great, I think), plus the Sky texture, would be absolutely amazing. Also, being able to control the size of the ground, because the one you have right now fits only some models. If a model is too big it's not visible at all, and if a model is too small it's absolutely massive.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
It's troublesome to add ground textures, because the game textures don't tile, I had to edit the one currently used. If you supply tiling textures, I wont mind adding this.
As to sky textures, I am not sure what the paths are. Pretty sure I didn't have to edit anything there though.

Added the ground size.
 
Level 1
Joined
Jun 24, 2014
Messages
4
So after a lot of hair tearing and frustrations, I finally managed to make everything work for MDX files. I ended up restructuring almost all of the old viewer's code.
 
Level 15
Joined
Feb 15, 2006
Messages
851
Just to inform the performance of this viewer in linux.
  • If you use glx-Mesa, there's no chance to load the viewer. That's normal because it's the basic and generic rendering.
  • With nvidia drivers, it works perfectly. No issues at all.
  • With AMD/ATI drivers, it fails at load the model, it just shows the ground model. It seems it loads the model and textures, but I have the feeling that the textures are not processed.

If I have time, I'll post some screenshots.
 
Top