Jump to content

animate or morph mesh dynamically


jerome
 Share

Recommended Posts

yep

need to do this also

 

the simpler would be to add the same delta (in percentage) to colors than to vectors

ex :

each vector3 has a delta added each frame deltaX, deltaY, deltaZ

we could just add this delta to R, G, B

Link to comment
Share on other sites

Yeah, the material is not really an issue that is part of the morph.

 

I don't know if you saw that I added the customTextureUpdate function idea to my last post.  That way you have isolated your mesh operations from any texture concerns, yet allowed an opportunity for material maniacs to play... during the morph.

Link to comment
Share on other sites

That is SO rad!  Jerome, nicely done.

 

What do you say to one more layer of fun?  Godrays, of course.  :)  http://www.babylonjs-playground.com/#27ZAG1#1

 

Ain't this fun?  Interesting godray knobs: 

 

Line 190 - the 50 means 50% quality, so tweak at-will.

Line 192 - exposure is nicely adjustable .1 to .4... but tweak hard on all 4 of these lines... if you're brave. Have sunglasses handy.  :)

Link to comment
Share on other sites

For people (we're not many loving to play for hours with this stuff) wanting to adjust this to your GPU :

 

as Wingy said : 

line 190 : godray quality : 50% ... decrease if you want more speed

line 192 : exposure from .1 to .4

you can play with godray parameters from line 192 to 195

 

line 40 : delay in ms between 2 changes

line 41 : nb of steps from a shape to the next one... a step per frame when morphing, must be an integer > 0

line 45 = m array : initial SH m factors. Values used for the first SH only. Must have 8 integers > 0 

line 46-47 = latitude and longitude... the length and width tesselletions. Reduce them if you want more speed, increase them if you want more detailed/smooth shapes. Not mandatory the same values.

 

the rest is computed or randomized  ;)

Link to comment
Share on other sites

I just paint.  YOU built the mansion.  :)  And yes, huge describes it well.

 

I can think of yet another feature.  An upper and lower limit on every SH m-number.  Wow.  hehe

 

So if I want m[2] to only get random numbers between 3 and 6 inclusive, then I could set the m2 ranger.

 

Just ridiculous.  :)  (you forgot about the fireTexture knobs, Jerome.  But the experimenters can find them.)

 

How many knobs, now?  About 25 places for users to turn knobs - on this mad scientist SH machine?    hehe.  Love it.

Link to comment
Share on other sites

Well, this little funny experiment validates imo the mesh update function as I can get a 32 x 32 SH (without godrays but with fire texture) morphing at 60 fps on my home old laptop.

 

Need to dive back into TS next week :)

 

 

 

 

 

(si aucun casse-bonbon ne vient me péter les rouleaux pendant que je code)

Link to comment
Share on other sites

Well, about SH, I think I will set the right values to have nice effects at 60 fps on a current computer. I'm able to get 60 fps on my old laptop (2007, core2 at 2.6 GHz and GPU mobile intel GM45 express chipset)

 

Do you prefer with or without godrays ?

 

Godrays are so nice but they reduce speed although they have no effect on the morph computation time which is always the same and can easily be set at a decent rate (depends mainly upon SH size, so number of vertices : latitude and longitude)

Link to comment
Share on other sites

Well, you know, J... godrays and fireTextures.. are clothing and paint.  Jewelry.

 

To keep your demo as on-topic as possible, I would say eliminate them both.  After that, author preferences.  You get the call, jeromino :)

 

It was my duty to stick my nose-in and spew my aimless opinion.  It's what I do.  heh.

 

Off-topic:  I used an animated tube as a godrays emitter, recently, in a lost playground scene.  It's traveling bulges made real nice "stripes" in the godrays fan-out.  It was beautiful and fun.  Then I started playing with uAng and vAng on the texture... and POOM!

 

Firefox crash.  The crash report panel popped-open and asked "Can you describe what you were doing?"

 

I thought about it for a moment, and then decided "No, I really cannot".  So I closed the panel and moved-on.   :)

Link to comment
Share on other sites

I also agree with DK, this demo shows so many BJS possibilities! godrays, ribbons, spherical harmonics fantasies, procedural fire texture, morphing... everything run smoothly, even on average comptuer, and only 200 lines needed to do the whole stuff. That's just impressive.

 

C'est pas un beau moteur 3D ça, m'sieurs dames !! B):wub:

Link to comment
Share on other sites

It will be far less than 200 lines very soon ;-) ... just because the update feature is now integrated in BJS !

I will refine it so it will be nice AND smooth on a average current computer.

 

Si, c'est du beau moteur comme on l'aime :D !

Link to comment
Share on other sites

  • 2 weeks later...

@DK :

 

At last : http://www.babylonjs-playground.com/#9LBJS

 

The final PG for the ribbon demo !

 

 

The code was cleaned, slightly commented and I tuned the parameters to get the more effects at 60 fps on most current computers (I hope).

As usual, the public version here : http://logiciels.iut-rodez.fr/proto/weathermap/test2/SH.html

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...