• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

View in 3D

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Could you upload the source code somewhere? I can take a look. Browser compatibility has come a long way, and I don't see how a simple button could be a problem.

Ctrl + U

PHP:
<button id="AnimationLoopingButton" name="AnimationLoopingButton" width="24" height="24" type="button"></button>

PHP:
#AnimationLoopingButton {
	position:relative;
	width:24px;
	height:24px;
	border-width:1px;
	border-color:#000000;
	border-style:solid;
	background-size:cover;
	background-image:url(http://www.hiveworkshop.com/model_viewer/Images/Looping.png);
}

And nah, browser compatiblity went nowhere, it's as bad as it always were.

I am not talking about the JavaScript side.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I inject keyframes to every node again. Injecting only to bones and helpers might help that specific tank model (and also for that model it only half fixes the facing problems), but it breaks others.

I need another way to work with abusive models that lack keyframes.

Fixed some more with particles.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Can't really say I implemented anything fully until I see all its different variants. Different variants can be implemented in completely different sections of the code.

Some more fixes:
You can now view models with no geosets (special effects etc.).
Some more issues with particles.
Getting bones from the bone chunk rather than the node list. Some models have bone nodes that don't think they are bones.
Now checking if the main model shader actually compiled and swapping shader units if it didn't.

I would like to implement z-sorting which would evade all the depth buffer issues (and as a side-effect would make the ground solid), but I can't seem to think of any way to connect node positions with geosets, Mdx doesn't seem to have that notion.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Added a cool super secret winter theme.
It can be accessed by either waiting for winter, or by adding to the address the super secret text "&winter" (zoom out a little for the full effect!).

Other changes:
- Optimized particle emitter rendering and memory consumption by a lot (but only those without emission rate keyframes).
- Removed the cached Base64 team color/glow textures. Loading them directly from the Hive gives the same results speedwise (especially since they are cached by the browser in any case).
- Optimized geoset rendering and memory consumption a little.
- Some other arbitrary code changes.
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
For anyone still having problems with firefox:
enter "about:config" in your address bar; then look for "webgl.force-enabled". If the last word in that row is "false" double click it and it should turn into "true". The view in 3d button should appear for you now.

I encountered two bugs with the viewer: node rotation is a bit off and particles are always billboarded (-> XYQuad doesn't work). Haven't checked anything else, but from what I have seen, this is pretty cool.
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
XYQuad is actually being used? I'll do a check for it then.

What do you mean node rotation is a bit off?

/Edit

Added XYQuad.

I'll be honest, I only really took a look at my own models and I tend to use XYQuad a lot ;P (thank you for adding; doesn't seem to have updated for me though)
The problem with the nodes is only one of particle emitters. Particles should move in a random direction away from the emitter; in your viewer, they are restricted to a line/plane, which makes the node look tilted, if you don't give it a closer look. Hope you know what I mean xP
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
I'm sorry to bug you again with this, but I think, particles are still not emitted correctly xP
Take this for example (death animation is the most obvious). It looks just fine if you look at it up front, but from the sides the particles don't seem to be emitted in a ball shape (which they should) but in a line or plane.
Also, you can see there, that gravity isn't displayed properly either. The "death sparklies" emitter has a gravity value of 1000, but in the viewer it doesn't show at all.
One other thing: Particles using "Tail" don't show properly. In this one the blue blobs on the bottom do actually not use head but tail, yet they act like they would use head only.
I don't insist that you fix any of this. Just saying, that some things aren't displayed properly. Your viewer already gives a really good impression of a model.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I'm sorry to bug you again with this, but I think, particles are still not emitted correctly xP
Take this for example (death animation is the most obvious). It looks just fine if you look at it up front, but from the sides the particles don't seem to be emitted in a ball shape (which they should) but in a line or plane.
Also, you can see there, that gravity isn't displayed properly either. The "death sparklies" emitter has a gravity value of 1000, but in the viewer it doesn't show at all.
One other thing: Particles using "Tail" don't show properly. In this one the blue blobs on the bottom do actually not use head but tail, yet they act like they would use head only.
I don't insist that you fix any of this. Just saying, that some things aren't displayed properly. Your viewer already gives a really good impression of a model.

Fixed the velocities.
Also added support for latitude keyframes. Any other keyframe types I didn't see and thus didn't implement yet?

What do you mean by gravity not showing?

What do you mean by not using the tail?
I fixed a syntax error with the tail decay code that didn't raise any JavaScript errors, so maybe that fixed whatever you mean.

Just a question.
When I open a model with this tool it says Downloading model files or somehting like that.
Does it really downloads the model to my pc??

The model is downloaded to your browser's memory.
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
Fixed the velocities.
Also added support for latitude keyframes.
Thanks, that's cool.

Any other keyframe types I didn't see and thus didn't implement yet? What do you mean by gravity not showing?
I guess "gravity" would be another key frame type, right? It's basically the acceleration in the (opposite) direction that the emitter node is facing.

What do you mean by not using the tail?
"Particles have two parts, the head and the tail. The head is just the texture, and the tail is a trail left behind the particles. The length is controled by the Tail length setting, and unfortunatly, tails aren't shown in the Model Editor, so the only way you can see the texture is with Head checked. ..." (taken from WILL THE ALMIGHTY's tutorial on sfx in magos)
You might wanna take a look at a model that uses tail particles in game so this makes sense. For example the ones in this map. The sun rays there would be tail particles.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
I know what gravity is, but what do you mean by the viewer not showing it?

Are you sure gravity can be keyed?
The parser has these keys for particle emitters (2):
  • KP2V: visibility
  • KP2E: emission rate
  • KP2W: width
  • KP2N: length
  • KP2S: speed
  • KP2L: latitude

And yeah, I forgot I can simply look at my parser to see all the keyed stuff.

As to tails, does the viewer look different than WC3ME? Because I pretty much copied Magos' code for the particles.

Added width, length and speed key frames to particles.
Keys not implemented yet are texture animation rotation and scaling keys. Are they used?

Oh yeah, I forgot to mention, I don't actually have WC3 on my computer, so I can't open that map.
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
I know what gravity is, but what do you mean by the viewer not showing it?
I mean that gravity in the viewer does not exist or at least it doesn't influence the particles in any way.
Are you sure gravity can be keyed?
The parser has these keys for particle emitters (2):
  • KP2V: visibility
  • KP2E: emission rate
  • KP2W: width
  • KP2N: length
  • KP2S: speed
  • KP2L: latitude
In addition to the keys you listed, Magos' also uses gravity and variation. I have no clue how this viewer you made was built or how it works so I guess I can't give any more information there :/
As to tails, does the viewer look different to WC3ME?
The difference is that Magos' doesn't show tail particles at all (which obviously isn't great, but o-k), whereas your viewer shows them as "regular" head particles, which could be misleading, but I don't think it's that big of a deal.
Keys not implemented yet are texture animation rotation and scaling keys. Are they used?
Not in Magos' I believe. Other than that I have no idea.

I also attached a screenshot from the testmap I linked you to. Probably not the best example, but I think you get the idea.
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
The model is downloaded to your browser's memory.

Actually, it's saved to your hard disk, and never removed until you manually clear your browser's cache. Go to "about:cache" (or C:\Users\%username%\AppData\Local\Microsoft\Windows\Temporary Internet Files for internet explorer) to see your browser's cache.

Frankster's Azure Dragon no longer seems to work.
Code:
Uncaught ReferenceError: i is not defined 
h.Mat4.decompose viewer.js:25
l.Model.updateNode viewer.js:98
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.update viewer.js:83
la
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I mean that gravity in the viewer does not exist or at least it doesn't influence the particles in any way.

In addition to the keys you listed, Magos' also uses gravity and variation. I have no clue how this viewer you made was built or how it works so I guess I can't give any more information there :/

The difference is that Magos' doesn't show tail particles at all (which obviously isn't great, but o-k), whereas your viewer shows them as "regular" head particles, which could be misleading, but I don't think it's that big of a deal.

Not in Magos' I believe. Other than that I have no idea.

I also attached a screenshot from the testmap I linked you to. Probably not the best example, but I think you get the idea.

I am not sure what the interface of WC3ME shows, but the code doesn't handle variation or gravity keys. Is there a model with those keys that I can test?

I don't understand what I am supposed to see in the image. Can you upload a gif please?

As to gravity, it's there...I am not sure what the issue is? I had a typo in the code, should be fixed.



Actually, it's saved to your hard disk, and never removed until you manually clear your browser's cache. Go to "about:cache" (or C:\Users\%username%\AppData\Local\Microsoft\Windows\Temporary Internet Files for internet explorer) to see your browser's cache.

Frankster's Azure Dragon no longer seems to work.
Code:
Uncaught ReferenceError: i is not defined 
h.Mat4.decompose viewer.js:25
l.Model.updateNode viewer.js:98
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.updateSkeleton viewer.js:94
l.Model.update viewer.js:83
la

Fixed.

AJAX requests get cached?
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
Yes, ajax requests are cached. A couple of things to note though:
- A request is still made, but the server can respond with 304 (not modified), in which case the browser uses the cached file.
- A URL includes query parameters, so file?v=3 is considered different from file?v=4
- Some headers ("Expires", "Last Modified", "Cache-Control") influence caching
I don't think ajax requests are stored on disk though. Probably only in-memory.
Edit: actually, they probably are. Browser caching happens at a lower level than ajax, so browser's don't care if it's ajax or otherwise.
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
I am not sure what the interface of WC3ME shows, but the code doesn't handle variation or gravity keys. Is there a model with those keys that I can test?
The interface suggests that variation and gravity can be animated. I don't know about a model that takes advantage of that, though and have thus no idea if it's actually possible or just an inaccuracy of the interface. I might check that tomorrow and upload an example model if I can get my Magos' to work.

I don't understand what I am supposed to see in the image. Can you upload a gif please?
I was just trying to give an example of how tail particles look in game. I've attached a more useful image that shows another model 1) in game 2) in your viewer 3) in Magos'.

As to gravity, it's there...I am not sure what the issue is?
Never mind, last time I took a look it didn't work - now it does.
 

Attachments

  • ExampleImage.jpg
    ExampleImage.jpg
    394.1 KB · Views: 94
Level 29
Joined
Jul 29, 2007
Messages
5,174
Never mind, last time I took a look it didn't work - now it does.

Edited that post. :)

Can you give me a gif of your model? Are the tails moving fast, slow, how do they look in action?
I can't really tell how the mechanism works, the only information it has is the tail length which is a negative number.

It obviously stretches the particles, but I can't see any connection as to how much, and how it fits with the rest of the particles.
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
WILL THE ALMIGHT compared particles to spermatozoons (which actually is a pretty good comparison :p ) meaning the tail originates from the head and ends back the way the particle came from. The tail uses the same texture as the head, but it's stretched depending on tail length and speed.
I don't think that model would have made for a good gif, so I made something else. In the screenshot you can see particles spawned by three emitters, which are basically the same except that the upper one spawns tail particles the lower one spawns head particles and the middle one spawns particles with both features.
127593d1373966692-view-3d-tailexample.gif
 

Attachments

  • TailExample.gif
    TailExample.gif
    1.6 MB · Views: 355
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
WebGl keeps "hitting a snag"(according to Chrome) when I just leave the viewer to load in the background. Also sometimes happens randomly. What's up with that?
Also, are billboarded particles and bones implemented yet?

Particles were billboarded from the moment they were added.
Nodes seem to be billboarded correctly in most cases, but not all.

As to Chrome blocking WebGL, it did it to me too a couple of times. Reloading usually fixes that. I am not sure if the cause is related to the code.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
WILL THE ALMIGHT compared particles to spermatozoons (which actually is a pretty good comparison :p ) meaning the tail originates from the head and ends back the way the particle came from. The tail uses the same texture as the head, but it's stretched depending on tail length and speed.
I don't think that model would have made for a good gif, so I made something else. In the screenshot you can see particles spawned by three emitters, which are basically the same except that the upper one spawns tail particles the lower one spawns head particles and the middle one spawns particles with both features.
127593d1373966692-view-3d-tailexample.gif

Making that model work was straightforward, but it still gives nothing similar to what the other effect should look like.
The tail length there is approximately -1.2, which is nothing even close enough to stretch the tails like what your screenshot shows.

Got any ideas?

Just take a look at this and you will understand what i mean. Teamcolored part of the model has it's normals reversed, so you can only see part of it. In teh viewer, the whole ball is covered in teamcolor:-/

Oh my bad, I forgot to delete something I put for debugging (I told myself I am going to forget it, guess I was right). Fixed.

As a side note, fixed the interpolation of the second and third segments of particles.

Is squirt used anywhere? in the thread you posted, a user said it means that all the particles shoot at the same time.
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
Making that model work was straightforward, but it still gives nothing similar to what the other effect should look like.
The tail length there is approximately -1.2, which is nothing even close enough to stretch the tails like what your screenshot shows.

Got any ideas?
As I said, the actual "tail length" that is shown in game also depends on the particle speed (and maybe size as well now that I think about it). I'm not quite sure how speed and tail length "stack"; common sense would suggest they do multiplicatively (not sure though).
The tail particle emitter in that test model uses a speed of 100, whereas the "Spike" emitters in the shockwave model have speed values of 150 and variation values of 0.5. If I multiply speed and tail length, the test model emitters would be at 200 (of whatever quantity this is) and the shockwave emitters, which use -1.2 tail length, at an average of (-)180 with a maximum of (-)270. Also, the middle one of the "Spike" emitters in the shockwave model has a tail length value of -1.5 so that might help explain that.
I'll check the connection between all those values and the visible texture stretching in game tomorrow.

Edit: Another thing I noticed is that all particles in your viewer actually are about two thirds of the size they should be (either that or it's handling distances wrong). The "size" property of particle emitters determines half the edge length meaning that a particle with size 50, actually is 100 x 100. This might also help explain, why the tails in that shockwave model are so very short. I updated that example model and added a "stand channel" animation to prove my point. The little glows should be exactly at the corners of the square.
(By the way and just for the record: XYQuad particles have a random z-axis-rotation, when they spawn in game; shouldn't make any real difference)

Apart from that, my "research" about tails got me the following results: Speed and tail length do stack multiplicatively and determine the actual tail length that way; for tail particles "size" only sets their width. Thus a particle with speed 100, tail length 1 and size 50 would not be stretched at all (same for speed = 200 & tail length = 0.5 & size = 50 or speed = 200 & tail length = 2 & size = 200).

I forgot to take a look at gravity and variation animation before. Now I did and turns out you're right (surprise :p) and it's just an error in Magos' interface; so they can't be keyed.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
I know WC3ME doesn't handle those keys (I looked at the source), I asked if you know about models that do have them.
But, of course, that's pretty stupid of me, because you wont know since WC3ME doesn't support them and thus you can't check if a model has them. :p
To know if they are keyed, one would need to parse all the original models from the MPQs...not worth the effort (not that it's hard, but if they can't be used by custom models, it wont matter in the first place).

I'll play some more with tails.

Thanks for your efforts!


Yeah I made a really silly mistake in the particle rendering, sizes should be correct now.
 
Last edited:

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
I know WC3ME doesn't handle those keys (I looked at the source), I asked if you know about models that do have them. But, of course, that's pretty stupid of me, because you wont know since WC3ME doesn't support them and thus you can't check if a model has them. :p
Ok. I just thought you *might* be mistaken because the interface suggests they could be animated (which apprently was stupid of me ;P ).
To know if they are keyed, one would need to parse all the original models from the MPQs...not worth the effort (not that it's hard, but if they can't be used by custom models, it wont matter in the first place).
Couldn't particles like that also be created in 3dsMax for example? It probably would be too much effort still.
I'll play some more with tails.

Thanks for your efforts!
Thank you for your efforts. Please leave me a message, when you don't need the test model anymore so I can delete it.
 
Status
Not open for further replies.
Top