Jump to content
Frankie Rockett

Animated Mesh - a particular technique

Recommended Posts

Posted (edited)

Hi
I have written asking about this mystery a couple of times before but no one seems to have any idea, which I find difficult to believe, so I'm trying again with a fresh example.

There is a particular technique of animating a mesh object that I am seeing that utterly baffles me and I wonder if any smart mesh coder out there can point the way for me?

Now one method I'm familair with is by combining many models together, each with a slightly moved posture, linking them all together into one multi-limbed monstrosity, then using LSL to switch them all invisible but one, then cycle through which one is visible to create the desired effect. You have one new model for each 'frame' of the finished animation. Now I understand that and that is NOT the technique I'm asking about.

The mystery technique operates on a single mesh object (no linked parts) that reports only 2 faces. An actual example: I recently bought a shark that has 4 tail swim positions. I have seen things with about 10 positions but lets keep this simple as an example. When working, the shark switches tail positions to create the illusion of wagging it's tail left and right. As there are only 4 positions in this example, the illusion is a little jerky, but it's the 'how'? of it I want to ask about. This shark is one object - not four. It's not one torso with four tails either. It's the Shiva of sharks - all one body with several tail fins. So - switching one body visible and the rest 'off' isn't possible here. Clicking on the various tails as I have to get their face number doesn't solve it either, as at least three of the tails have the exact same face number. I have seen other cretaures that have many more than 4 positions, and these too are all one model with a similar paucity of faces, so -  it's NOT about addressing different faces and telling different faces to switch on and off either.

So summary - we have a multi-phase animated creature with more 3D new positions than there are objects - or faces - in it's composition. How on earth can I start to accomplish something like that myself?

Only if you actually know please!

Regards

Frankie.

Edited by Frankie Rockett
Multiple typos !

Share this post


Link to post
Share on other sites

Two possibilities come to mind:

1. The tail is simply being rotated at its base, using SLPPF or llTargetOmega (or both).  That could be quite effective if the tail fins were flexi.

2. The creator is using animesh, which is designed precisely for that sort of thing.

Share this post


Link to post
Share on other sites
Posted (edited)
32 minutes ago, Frankie Rockett said:

Only if you actually know please!

Never heard of animesh before? 

 

Edit:Rolig was faster 😅

Edited by OptimoMaximo

Share this post


Link to post
Share on other sites

In the 3D mesh world "faces" translates into "materials" at least in Blender (or simplistically TEXTURES). 

image.thumb.png.40d49e8b14a29c380a10f25c3fe9e3ae.png

For example, this simple plant base is ONE mesh object with ONE face (all the same texture).  You cannot change one plant in this group without changing the others).   So it would be fairly simple to make slightly different textures -- movement wise -- and cycle through loading them. I suspect (not much of a script person) that you could alternately move the offsets slightly in various directions via scripts and cycle through those.  

 

In this example there is still a SINGLE MESH object but in this case it has four "faces" with four separate materials in the file. So each of these plant stalks can be changed independently -- either by changing the texture in the build menu or by scripting. 

 

image.png.84054004d4b136d2ac64a86313fcaa7f.png

Share this post


Link to post
Share on other sites
48 minutes ago, Frankie Rockett said:

The mystery technique operates on a single mesh object (no linked parts) that reports only 2 faces.... all one body with several tail fins.... as at least three of the tails have the exact same face number.

It's hard to say for certain without inspecting the object in question but the most likely explanation for what you describe is:

The body is one material and has a regular texture on it.

The tail(s) are all sharing the same material/texture, but have different uv mapping, with the UVs of each tail being located in a different quadrant/section of the texture map.

The tail texture appears in only one section of the image, the rest of the texture is transparent, and the tail "animation" is achieved by changing the offsets of the texture on the tail(s) to change which one of them is currently visible (most likely with the use of llSetTextureAnim).

 

It's a crude but reasonably effective way of simulating animation, but before you use this particular method I'd suggest taking a look at animesh.  It allows you to create far more realistic and efficient animated content than the various forms of "alpha swapping" that are currently in use.

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, Rolig Loon said:

Two possibilities come to mind:

1. The tail is simply being rotated at its base, using SLPPF or llTargetOmega (or both).  That could be quite effective if the tail fins were flexi.

2. The creator is using animesh, which is designed precisely for that sort of thing.

Hi Rolig
No that's not it I'm afraid.
1. There's no actual movement - it's flashing on and off one of it's 4 tails as I said.
2. An animesh character is capable of following an animation file. As such it wouldn't need 4 tails: unless you want to animate a 4 tailed shark!

Frankie.

Share this post


Link to post
Share on other sites
2 hours ago, OptimoMaximo said:

Never heard of animesh before? 

 

Edit:Rolig was faster 😅

Never heard of sarcasm-free responding before? Oh I forgot - I'm in a forum - always at least ten flamers. It's ok I don't give a **** about fire-retarded posters.

Edit: Rolig was courteous.

  • Haha 1

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, Frankie Rockett said:

I recently bought a shark that has 4 tail swim positions. I have seen things with about 10 positions ...

This strongly suggests the objects use texture animation as Fluffy describes (rather than Animesh). If so, the geometry of all the positions should be visible superimposed when you highlight transparent -- as you say, the "the Shiva of sharks." The reason the number of positions are kept small with this approach is that the animated texture must be sparsely populated (mostly transparent), and the more positions the more sparse it must be, with the instantaneous amount showing varying as a square of the number of positions. There are tricks, but generally speaking, a 4-position tail only shows 1/16 of the texture at any time; for 10 positions only 1/100.

If you try making such a texture, the advantage of a power-of-2 position count becomes apparent, and 8 is kind of the upper limit with this pure texture-animation approach, with a 1024 square texture showing only 128 square pixels at a time. The alternative is actively pushing a sequence of textures onto the mesh, which makes the texture portion showing order n instead of n² but requires the script to keep running and the textures to load.

Edited by Qie Niangao
(technically it's the AMOUNT SHOWING that varies as the square of positions, not the overall texture sparseness)

Share this post


Link to post
Share on other sites
Posted (edited)

That would be one cool shark.  It could get the lead role in the next Sharknado movie.

You make good points, filling in some information that helps.  In that case, the answer is probably that the creator is fiddling with texture offsets and more than one UV map, as others have suggested.  I've worked with a couple of mesh artists who use that approach recently.  

Edit:  Heh, this time Qie beat me, and with more detail.  Run with his response.

Edited by Rolig Loon

Share this post


Link to post
Share on other sites
2 hours ago, Chic Aeon said:

In the 3D mesh world "faces" translates into "materials" at least in Blender (or simplistically TEXTURES). 

image.thumb.png.40d49e8b14a29c380a10f25c3fe9e3ae.png

For example, this simple plant base is ONE mesh object with ONE face (all the same texture).  You cannot change one plant in this group without changing the others).   So it would be fairly simple to make slightly different textures -- movement wise -- and cycle through loading them. I suspect (not much of a script person) that you could alternately move the offsets slightly in various directions via scripts and cycle through those.  

 

In this example there is still a SINGLE MESH object but in this case it has four "faces" with four separate materials in the file. So each of these plant stalks can be changed independently -- either by changing the texture in the build menu or by scripting. 

 

image.png.84054004d4b136d2ac64a86313fcaa7f.png

Thank you Chic. Unfortunately that's not the case here. In your examples (which seem to be designed to change texture as opposed to creating the illusion of animation), all faces of the object are showing at once. Not these animated mesh's. I can see (if I break them) that there are multiple limbs (or whatever seems to be in motion). If it were some kind of texture switching then two questions arise - how do you address different areas of the same single object that share the same face (the core of my post question), and even if you could, the loading time would lag behind the repid motion needed - so if you can load a texture it'd be quicker to load them all then just switch visibility on and off which you can do very quickly. So, nice line of attack but the central question remains - how to make (e.g.) some PART of object 1, face 1 go transparent, while switching another part of the same object 1, face 1 go visible?!!

Thank you for your thoughts though :)

Share this post


Link to post
Share on other sites
2 hours ago, Fluffy Sharkfin said:

The tail(s) are all sharing the same material/texture, but have different uv mapping,

Ooh Fluffy!
This sounds interesting! "UV Mapping" - never heard of that so I'm going to beat Google until it comes clean on it - thank you. I don't want to be Mr Glass Half Empty when you've just thrown me such a hopeful explanation, but one pessimistic heads up on it  - I looked at the objects texture and it is just one texture all over - head, body, all it's tails. That texture however has no transparent portions on it. Could the UV method still be the way this was achieved do you think?

Thank you too for the extra knowledge about Animesh being more efficient. I assume by that you mean 'causes less lag' than a scripted alpha changing object?

Thank you!

Share this post


Link to post
Share on other sites

One thing to be aware of about Animesh: it has a minimum Land Impact of 15... which may be fine for a swimming shark (and lots of other stuff) but really gets in the way of using it for smaller items. It's "more efficient" in the sense that it exposes less geometry to view, and probably less texture surface area. Neither approach should use much if any script runtime at all.

(It occurs to me that some simple applications might use texture animation by simply cycling through the identical portion of image on each of the positions, so there'd be 1/n of the texture visible at any time, but that same portion would appear at each position. I've never had that option on anything I've made like this, but I'm thinking shark fins don't really look much different from one part of their motion to the next.)

Share this post


Link to post
Share on other sites
Posted (edited)
44 minutes ago, Qie Niangao said:

e = MC(squared) * SqRt -1  /  pi/r(squared)

Hi Qie!
Ok I may have misquoted you there slightly but I only make the point that your maths is so far above my paygrade, therefore: 'we are not worthy'!

Teasing out of that the parts I did follow, then as I said to another writer here, my observation would be that, looking at the texture used (and I had to break it to get this view) I see no transparent portions. Here's an image grab to illustrate what I am describing:

I hope this helps.

 

Forum-Image.jpg

Edited by Frankie Rockett
Typos

Share this post


Link to post
Share on other sites
6 minutes ago, Frankie Rockett said:

(and I had to break it to get this view)

Some additional information on how exactly you "broke it" may help to shed light on the method being used to animate it.

Share this post


Link to post
Share on other sites
Posted (edited)

Good idea, although I hate to sound like a vandal, but since you ask... - I dragged the script out to halt it since it wouldn't shut off any other way, then I explored it by clicking all over & viewing transparent - found three transparent tails (that much was obvious before I wrecked it - they alternate on and off like traffic lights). Eventually these became visible when I saved it to inv and re-rezzed it.

Edit: ok not 'vandal' but 'controlled decomposition researcher'!

Edited by Frankie Rockett
The usual slew of tiepos / tighpoes / tihighpos / writing mistakes.

Share this post


Link to post
Share on other sites
1 hour ago, Qie Niangao said:

a 4-position tail only shows 1/16 of the texture at any time; for 10 positions only 1/100

I'm not sure I follow your math here Qie, or maybe we're thinking of slightly different methods.  To illustrate here's an example tail alongside the uv layout and corresponding texture.

tail-uv-example.thumb.JPG.6ee2e33f4ec45fdce682c8ce60bce22d.JPG

As you can see each of the four tails use approximately 1/4 of the texture space (the other 3/4 being transparent).  Adding a texture animation with the PING_PONG flag set would cause the tail to appear to move from side to side as that opaque section of the texture lines up with the uv mapping for each segment.

Of course the limitation of this method is that you have to use the same texture and uv island layout for all versions of the tail and only modify the vertex positions of the mesh rather than having individual textures and uv layout for each version of the tail.

Share this post


Link to post
Share on other sites
1 minute ago, Fluffy Sharkfin said:

Of course the limitation of this method is that you have to use the same texture and uv island layout for all versions of the tail and only modify the vertex positions of the mesh rather than having individual textures and uv layout for each version of the tail.

Yes that's exactly right. Every time I've done this, each of the positions needs at least a slightly different surface look, so I couldn't just offset the same image across the UV map... but yeah, a shark tail may do perfectly fine with that approach.

(I tried to add a note to this effect to a later post, but I'm often less than clear and all this is pretty obscure to describe.)

Share this post


Link to post
Share on other sites
18 minutes ago, Frankie Rockett said:

Good idea, but I hate to sound like a vandal but since you ask... - I dragged the script out to halt it since it wouldn't shut off any other way, then I explored it by clicking all over & viewing transparent - found three transparent tails (that much was obvious before I wrecked it - they alternate on and off like traffic lights. Eventually these became visible when I saved it to inv and re-rezzed it.

The fact that the additional tails only became visible after being taken into inventory then re-rezzed is curious, and lends credence to the theory that it's using texture animation somehow (since texture animation is an object property that persists after the script that initiated it is removed, but can be broken when taking the then unscripted object back to inventory and re-rezzing it).

Sorry to ask a really obvious question but you do have "Select Faces" selected in the build window and you've selected the tail face and not the face that corresponds to the body rather than the tail right?  It's just the texture in the preview window doesn't look compatible with any type of texture animation and it's hard to imagine what method they could possibly be using to do alpha switching on the tail given what you're describing and the screenshot you posted.

Share this post


Link to post
Share on other sites
Posted (edited)
51 minutes ago, Frankie Rockett said:

Teasing out of that the parts I did follow, then as I said to another writer here, my observation would be that, looking at the texture used (and I had to break it to get this view) I see no transparent portions.

Yeah, it would be great if there's some way you can "catch" this shark to Select Face of the tail section while the shark is "swimming" (so only one tail position is showing) and see what that texture looks like.

Edited by Qie Niangao

Share this post


Link to post
Share on other sites
2 hours ago, Frankie Rockett said:

I don't give a **** about fire-retarded posters.

Says who, by inspecting an object, can't tell if it's an alpha flipping or an animated texture, and not being able to describe the latter properly for others to understand. Good job! 😂

Share this post


Link to post
Share on other sites
1 hour ago, Fluffy Sharkfin said:

Sorry to ask a really obvious question but you do have "Select Faces" selected in the build window and you've selected the tail face and not the face that corresponds to the body rather than the tail right?

The slightly depressing universal answer is that no matter which face I select they all have (is that 'both' have - I haven't probed every milimeter looking for another face) the exact same texture - the one as seen here.

Share this post


Link to post
Share on other sites
1 hour ago, Qie Niangao said:

Yeah, it would be great if there's some way you can "catch" this shark to Select Face of the tail section while the shark is "swimming" (so only one tail position is showing) and see what that texture looks like.

Oh that would be good! I should set aside my conviction that all I'd see is a 'transparent' texture and try it. There are two barriers to this of course. For one it's broken and I'm not sure I learnt much from breaking it; buying another - ditto. Secondly, the 'flashing' on and off of tail positions is too fast for me to select it anew and inspect the texture - it would have cycled well past that tail's (in)visibility by then I would imagine.

Share this post


Link to post
Share on other sites
43 minutes ago, OptimoMaximo said:

Says who, by inspecting an object, can't tell if it's an alpha flipping or an animated texture, and not being able to describe the latter properly for others to understand. Good job! 😂

Not quite clear if that's a question - as it starts out, or who the subject is - in what seems like a statement in the middle section, before reaching what looks to me like an exclamation.

But - 'yeah right!'

Share this post


Link to post
Share on other sites
1 hour ago, Fluffy Sharkfin said:

I'm not sure I follow your math here Qie, or maybe we're thinking of slightly different methods.  To illustrate here's an example tail alongside the uv layout and corresponding texture.

tail-uv-example.thumb.JPG.6ee2e33f4ec45fdce682c8ce60bce22d.JPG

As you can see each of the four tails use approximately 1/4 of the texture space (the other 3/4 being transparent).  Adding a texture animation with the PING_PONG flag set would cause the tail to appear to move from side to side as that opaque section of the texture lines up with the uv mapping for each segment.

Of course the limitation of this method is that you have to use the same texture and uv island layout for all versions of the tail and only modify the vertex positions of the mesh rather than having individual textures and uv layout for each version of the tail.

Yes, that's what I thought Qie was describing. Hence my illustration to counter the theory - how the texture seems not to have any transparent portions in this case.

Share this post


Link to post
Share on other sites
2 hours ago, Frankie Rockett said:

Yes, that's what I thought Qie was describing. Hence my illustration to counter the theory - how the texture seems not to have any transparent portions in this case.

So, do you have a marketplace listing url or a location in-world where we can buy/see said shark?

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...