• 🏆 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!

New 3D model viewer

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
I am planning on making a new version of the model viewer (yes, it's going to have animations).

If anyone has suggestions on things to improve, please post them here.

If your suggestions relate to how MDX models work (e.g. adding global animations and particles), then add whatever info you have on them.

I would like to have suggestions on the UI, such as buttons, key shortcuts, the loading bar, etc., since the current one is pretty bad.

Features that I already know need to be implemented are relative zooming and translating (as in, move/zoom more or less depending on the current zoom), some sort of animation selector, a camera selector, and making the viewer stretch to the window opened by the Hive (browsers seem to have arbitrary rules on this one).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Perhaps the ability to look at the wireframe so you can more easily tell if the poly count is really high or not.

I like that idea (also I guess adding statistics in the first place might be useful).

It seems over all that the fact that the 3D button appears for some and doesn't for others makes confusion.
Might ask Ralle to put some notice that you can't view in 3D instead of just not showing anything.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
A flash player front instead of HTML5. That way 95%+ of people could view it on all browsers instead of the current 20% or less on select browsers who are willing turn on the feature.

Lets us not forget that security experts are arguing over if it is safe to use WebGL.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
A flash player front instead of HTML5. That way 95%+ of people could view it on all browsers instead of the current 20% or less on select browsers who are willing turn on the feature.

Lets us not forget that security experts are arguing over if it is safe to use WebGL.

Security experts are arguing if the world is safe to live in. Or are you talking about nonsense like image-stealing shaders? I mean, we can't go and Right Click -> Save images in browsers, so obviously doing that with shaders is a security threat.

As to WebGL support, all the major browsers support it good enough as far as I know.
Flash was never meant for 3D, and it will never be good at it. No thanks to rendering with no hardware acceleration.

I would suggest zoom in/zoom out and animation buttons. These would be nice for a viewer.

It already has a zoom function (mouse scroll or Page Up/Down), and the main point of making the new version is for animations. Don't you read? :|


And in an unrelated note, the new Mdx parser is done, yey.
 
Last edited:
Level 8
Joined
Feb 21, 2005
Messages
110
It would be great if you could "move" the model, as in simluate a unit's movement. This would enable people to see how projectiles with particle emitters and ribbon emitters look like when they're not standing in place.

In general I'd like it to be a fixed version of Mago's Model Editor, i.e. with ribbons and emitter tails etc.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Particle emitters are not really on any great priority, but we'll see how well the animations go.
If the animation code goes smoothly, geoset animations will follow first, since you can't see anything in models with many objects (try that 255 animation peasant model - or whatever it was called - for example).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Wikipedia also says Internet Explorer supports WebGL via a plugin. However after downloading this plugin your model viewer still does not work due to other script errors (says it can not find the one "split" method).

That can be worked on with testing, after I have a finished viewer.

Hi there.
I'm Marla. I'm currently looking for my own Tyler. You know, like in Fight Club. It can be sooo much fun.

...what?
 

Deleted member 177737

D

Deleted member 177737

Wikipedia says Opera 12 supports WebGL. There is nothing I can do for older versions.

I'm running opera 12 and the test you linked a post or so above says it doesn't support WebGL.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I'm running opera 12 and the test you linked a post or so above says it doesn't support WebGL.

Can't help you there. WebGL might be disabled by default and you need to enable it, or it might be only in the dev version. I have no idea.


Wikipedia also says Internet Explorer supports WebGL via a plugin. However after downloading this plugin your model viewer still does not work due to other script errors (says it can not find the one "split" method).

You know what's funny? IE can run WebGL with the IEWebGL, but the viewer still can't work in IE.
Those smart people at Microsoft decided not to implement the XMLHttpRequest.overrideMime method, so I can't get binary data. Presto.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
Those smart people at Microsoft decided not to implement the XMLHttpRequest.overrideMime method, so I can't get binary data. Presto.
And I take it there is no hacky work around like reading the file as text and converting each character into binary? The error message at the provided link also is reporting to me that I do not have WebGL when I do have the plug in installed. Does this mean the plugin is not good enough or is your error message incorrect?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
And I take it there is no hacky work around like reading the file as text and converting each character into binary? The error message at the provided link also is reporting to me that I do not have WebGL when I do have the plug in installed. Does this mean the plugin is not good enough or is your error message incorrect?

It's not conversion issue, it's that the responseText member is just not the same.
After some digging, it seems IE implements their own responseBody member, which can't be manipulated by JS (because Microsoft are smart, as usual).
More digging brought up a script (first one) that makes a VBScript dynamically that turns that into a JS string.

I'll check if this works.

As to WebGL itself, I have not put it in the viewer, just a test page, and it seems to work.

Edit:
The fun got bigger.
Internet Explorer supports typed arrays only from version 10.
Emulating DataView for Firefox was annoying, but for IE I will need to emulate the whole Typed Arrays specs, apparently.
No thanks.
 
Level 34
Joined
Sep 19, 2011
Messages
2,120
Well it's realy glitchy on google chrome. Hope you will add global sequence and particles soon.
Yes, this guys is running upside down>_>
 

Attachments

  • lol'd.jpg
    lol'd.jpg
    21.2 KB · Views: 154
Level 29
Joined
Jul 29, 2007
Messages
5,174
Well it's realy glitchy on google chrome. Hope you will add global sequence and particles soon.
Yes, this guys is running upside down>_>

Yes, I know about that. It is caused by exporters not exporting correctly the beginning and end keyframes of sequences.
As in, suppose you have two sequences, one in the range [100, 1000] and the second in [1500, 2000], the exporter doesn't necessarily export keyframes at 100, 1000, 1500 and 2000.
I tried entering "default" keyframes (no translation/rotation/scaling), which fixed all those models based on the archer from facing down, but it introduced other issues with other animations.

Edit
Ok, I seemed to have fixed it. I'll merge it with the public viewer soon.

Edit
Merged.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Added geoset animations. Seems to bug a little at weird models, but works mostly.

Edit
This is pretty amusing (open in Internet Explorer).
Still, it fails to show the textures, for some reason, and it has many other issues.

Edit
Compressed the viewer to one tight file, and added into it the team colors and glows. This should make loading a lot faster, hopefully (the whole thing is 39KB after Gzip compression).
The real bottleneck is loading the model viewed itself, but there's nothing to do about that.

Edit
Using native browser XMLHttpRequest.responseType set to ArrayBuffer now (seems to be supported in Firefox and Chrome, don't know about others), so I get the data directly instead of converting it byte by byte.
As far as I can see this makes loading a ton faster.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Added hardware animation (as in, the graphics card now does the animation calculations for all the vertices) if the target graphic card is good enough for the specific model viewed.

For example, most cards from the past 4-5 years support ~256 4D vectors which means 64 4x4 matrices.
So if you have such a card and you are viewing any model with 62 or less bones (I reserved 2 for other things), it will run on the graphics card.

If the graphics card isn't good enough, the code runs as it always did.

If you want to check what mode you're running on, open your browser's Console. I added a message which varies between "Animating on the GPU." and "Animating on the CPU.".


In an unrelated subject, the animation seems pretty spiky (sometimes suddenly runs faster for a moment) in Firefox. I believe this is because of the garbage collector being crappy (which is why the FPS keeps jumping from time to time too).
Seems to run smoothly on Chrome.
 
Level 11
Joined
Mar 18, 2009
Messages
788
I use Chrome and I really like the new 3D viewer :D
But The camera is a problem for me, it only shows No camera and Portrait.

Zooming or changing the angle and stuff doesn't work (I don't know if it has been added). Since only the Portrait option views the model it doesn't work very well to view some models since the portrait is mostly showing the face and shoulders.

Nevertheless, its great to see the upgrade :)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I use Chrome and I really like the new 3D viewer :D
But The camera is a problem for me, it only shows No camera and Portrait.

Zooming or changing the angle and stuff doesn't work (I don't know if it has been added). Since only the Portrait option views the model it doesn't work very well to view some models since the portrait is mostly showing the face and shoulders.

Nevertheless, its great to see the upgrade :)

The list of cameras is taken from the model itself. Some models have no cameras defined, some have portrait, while others might have other cameras.

If you select a camera, you view through a camera defined by the artist, hence why you can't change your view.

Switch back to No Camera and you would be able to zoom, rotate and move around as you like.
 
Level 11
Joined
Mar 18, 2009
Messages
788
The list of cameras is taken from the model itself. Some models have no cameras defined, some have portrait, while others might have other cameras.

If you select a camera, you view through a camera defined by the artist, hence why you can't change your view.

Switch back to No Camera and you would be able to zoom, rotate and move around as you like.

I've tested it on 7 models now and not one of them worked in the No Camera mode. I tested on 5 unit models and 1 building and 1 spell model, only those with the portrait option could be viewed at all (in that specific mode).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I've tested it on 7 models now and not one of them worked in the No Camera mode. I tested on 5 unit models and 1 building and 1 spell model, only those with the portrait option could be viewed at all (in that specific mode).

That is quite weird.
I just tried this and it worked fine here.

Can you maybe open the JavaScript console (Ctrl + Shift + J) and see if it shows you errors?

Edit
Ok, the Closure compiler went and deleted some of the code making it invalid. For some reason the viewer still works fine on Firefox even when it shouldn't.
I'll fix it tomorrow (it's today already...).

Edit
It ended up being something a whole lot simpler, and a lot harder to notice.
"translate" is now a property of HTML elements, so it overrided my function and made it invalid.
 
Last edited:
Level 1
Joined
Jul 7, 2012
Messages
8
Maybe, what would be a great thing, making the "view-window" itself a bit bigger, as now it's only a small part in the top left corner while the rest of the picture is regular hivebrown.
 
Status
Not open for further replies.
Top