Jump to content

The Wingnut Chronicles


Wingnut
 Share

Recommended Posts

Thanks josh, but that's not really true.  I just have a great toolbox called babylon.js, which lets me look like a hot coder, even though I suck.  :)  But YOU are pretty amazing... that's for sure.

 

Well gang, I guess it's time for another weird Wingnut demo, so here we go!

 

I went looking for a way to translate an object with a setPhysicsState... without using applyImpulse.  I didn't find it, but I found a strange workaround that can be done in an animate function... and I used it in this demo.  Move the mesh, set its physicsState AGAIN, set its physics link to the top of the chain AGAIN, and go.

 

Yes, setting a physics state and physics link inside an animation loop... seems strange, but we like strange.  :)

 

After that worked, things just got totally out of hand with the experimenting fun.

 

Fun experimenting lines are...

line 48 - set how many links in the chain

line 51 - what kind of mesh for each link

line 55 - adjust the restitution as high as 20 for large explosions when the chain collides with itself

line 55 - change from SphereImposter to BoxImposter or PlaneImposter

lines 121 and 126 - speed and sweep of the 'stead', the green box that the chain is trying to remain linked-to

  example:  line 121 - stead.position.x += Math.cos(alpha)/4;     line 126 - alpha += .03;

 

A person could mess with scene.gravity, too!

 

Physics linking is TOO MUCH FUN!  Be careful!  Remember to eat and sleep!!!  :)  Party on.

Link to comment
Share on other sites

Hi gang!  It's time for Sunday night demos at The Wingnut Chronicles, again.  This time, I am continuing with the physics linking foolery... with this out-of-control demo.

 

Now there is some terrible coding, Josh.  :)   I'm SO proud!

 

Early work is happening on a universal chain-maker function called makechain and it has about 500 parameters.  The frame rates aren't TOO bad, but we can tell that Oimo is having to work like hell.  Don't forget that I am a terrible coder, though, and this code could certainly be improved, performance-wise.

 

The original objective is/was to make a Newton's Cradle. 

newtons_cradle_498x255.jpg

 

We need 6 more chains to accomplish it (the classic versions  have 10 strings), and I think that Oimo will have a nervous breakdown in the process.  Do we absolutely need 10-link chains for the 10 Newton's Cradle strings?  No.  We could use very thin sticks (like chopsticks) instead of strings.  But, in doing that,  a person could never get the strings to bend whatsoever.  Then again, Newton's Cradle strings don't bend very much, either.

 

One might ask one's self, "Why do the box-chains in the demo... always swing in a +/- Z direction?  Why not +/- X?  hmm.

 

Oh well, it is a demented mad scientist demo, that much is surely true.  Zip a copy and take it home, and see if you can make your CPU start smoking.  It's all good fun (at least until someone loses an eye).  Kids, don't use this demo as a "how to write good JS" example, ok?  *nod* 

 

If anyone wants to "run-with" this, feel free.  My code is your code, always.  Does anyone want to make a Chain class for us?  Please do (and then share it, thanks).  :)  Party on!

Link to comment
Share on other sites

Hi girls!  I suspect everyone is about sick and tired of Christmas stuff... but...

 

...wanna take a sniff at a BJS forum search page that I've been stealing and hacking?  I knew ya did.

 

http://urbanproductions.com/wingy/babylon/search/form06/form06.htm

 

Work in progress, but... I think it looks pretty nice, thanks to Gryff.  Some local friends are having display problems though.  And my feathering techniques are pretty bad.  I'm working on it.  :)  Party on!

Link to comment
Share on other sites

Sorry.  I still have lots of old CSS in there.  My control-mousewheel is acting weird, too. 

 

Did you find the cause of the problem, yet?  C'mon!  ;)  Do I LOOK like a webmaster?  heh.

 

There's a half-meg pile of JS that has to ride along with this.  I have no idea what most of it does... i just included it or it wouldn't work.  :)  I don't doubt that's full of hell. Sigh.

Link to comment
Share on other sites

Replace this in your css wingnut : (Your background image will be better adapted to all screen sizes)

html{     width:99.9%;    height:100%;    padding:0px;    margin:0px; }body {    background-image: url(./form_files/bg01.jpg);    background-attachment : fixed;    -o-background-size: 100% 100%;    -moz-background-size: 100% 100%;    -webkit-background-size: 100% 100%;    background-size: 100% 100%;     width: 100%;    height: 100%; }
Link to comment
Share on other sites

Thanks, Dad72!  Nicely done!  I dropped the sizes in the html style to width:99.0%; and height:98.0%;   ...which made the scrollbars finally turn-off in my FF.  I hope that didn't mess it up for others, again.  If so, I'll change it back immediately.

 

Thanks for your assistance!  Republished.  All further ideas and assistance... very welcomed and appreciated.

 

Someday, I would like to have many backgrounds from many people's Babylon scenes (and editors)... so we get a random background each time the page is loaded.

Link to comment
Share on other sites

Hi again, gang!

   Nothing really exciting happening, but I began researching and experimenting with text printing on dynamicTextures, and learning about CanvasRenderingContext2D (crc2d) objects.  Take a look.

 

One objective was to begin testing a multi-line drawText function (essentially a drawParagraph() function).  One page that I found during my reasearch... was this:  http://delphic.me.uk/webgltext.html  (thanks delph!)

 

So, I borrowed some code from there, and built myself a very messy crc2d mad scientist lab.  :)  Then I tried some retarded things like canvas.translating and trying to use a displacement to make the text extrude a bit.  I also tried animating the wrapU/V, after unclamping its addressmode (huh?). 

 

All failed, but that's part of the fun of being a mad scientist, right?  All the debris from those tests, all the alerts, all the brain damage... is still strewn across the ground of this playground.  Big and messy.

 

Grab a zip or play around with it in the playground, teach me what you learn, show me what you make, and have a ton of fun.  Experiment with the textHeight, maxWidth, and textToWrite on the tobj parameters object... for fun.  Toggle the boolean on that tobj.squareTexture to make things completely mess-up.  :)  *scratch scratch* 

 

crc2d is a BEAST!  Hard to tame!  :)  Learning learning learning.  Party on!

Link to comment
Share on other sites

Hmm, my continuous begging for attention... seems to be working.  hehe.  There's a really great guy that used to hang around here all the time... Gwenael.  He used to beg me to PLEASE start new threads and stop posting in the same thread over and over... while often changing subjects.  Too funny.

He just didn't understand that I was building a repository of babbling.  A place where anyone could pull up a chair and a beverage... and start yapping... about anything.  A Babylon microphone.  :)  It's a place to vent... when you don't want any limelight or spotlight.  A place to reach into one's diaper, grab a hunk of creativity, and smear it on the wall.  Gotta love it.  :)

AltReality recently reminded me of how much I love waves moving through mesh vertex positions.

http://playground.babylonjs.com/#1AVEYO#13  (pretty nice!)

Other geniuses have moved waves through mesh... and I got addicted to playing with them... EVERY TIME.

http://www.html5gamedevs.com/topic/7792-bjs-113-new-features-and-demos-lines-and-dragdrop/page-2#entry47341

So, this "smear on the wall" is an early attempt to apply waves to a highly-subdivided cap-less cylinder.  Pretty fun.  Using a hijacked CreateCylinder func from the vertexData class (renamed to PlotCylinder) and another CreateCylinder wrapper-func from the Mesh class... I did my best to make a mess experimenting with sin and cosine.  Maybe I'll get it animating someday.  Maybe somebody will do that FOR me.  :)  Maybe mom is going to spank me for smearing that stuff on the wall.  :)  Party on!

Link to comment
Share on other sites

  • 1 month later...

Hi gang!

   It's been a while.  I think I'm recovered from a recent public spazz-out.  I hope I didn't cause any permanent damage.

 

Recently, I decided to try to assemble what I will call a GNGT piping line on my Windows 7 crapbox.

 

GNGT = Gitbash-Nodejs-Gulp-Typescript

 

Reading, learning, watching videos, I'm taken back in time to unix-ville... a place I spent very little time.  :)

 

But check this out...

gitnode01.jpg

 

Ain't that just the coooooolest!?  The "GN" part of GNGT... is done!  Gitbash and Nodejs.  YAY!

 

I tell ya... the most miserable part... was re-learning how to loosen the perms on a Windows folder (the nodejs folder).  I had to add an "Everyone" permission object to that folder.  Ownership, run-as-admin, all other methods... refused to let a desktop shortcut to nodejs.exe... have permissions.  Desktop shortcut permed-out, and so was gitbash attempts to accomplish node -v.

 

I (admin level user) even owned the nodejs folder.  Go fig.  MS Windows, herf, sigh.  Dummy Wingnut, too.

 

Next step... I'm going to make sure I have a recent version of npm, so I can prepare to run (use) the Gulp and Typescript npm modules!  Holy cow!!!  An idiot MIGHT be able to pull this off!  Piping streams might be FUN!  More soon.  Party on!

 

PS: Jerome is building the same pipeline, but in a linux environment.  I think he might try to stream from his editor.  I will likely be streaming from a folder... but my Boxer text editor does have quite a "add tools" area which might easily allow running a batch file. 

 

I'm watching two of Jerome's threads carefully, this one and this one.  He's getting some good advice from experienced forum folk.

 

Update: installing Gulp and Typescript modules went perfectly.  omg!  Windows Subway System complete!  Look out!

Link to comment
Share on other sites

  • 2 weeks later...

Hi Temechon!  Good to hear from you, as always!  Great work on BabylonDocs!  Thanks for being our documentation hero.  I'm still learning to drive it, as you know.  It's pretty sweet!

 

Hey gang, have you seen the new Volumetric Light Scattering demo at the playground?  It's BEAUTIFUL!  Wow!

 

I am going to go mad-scientist-crazy on this new BJS feature!  Yum!

 

Of course I HAD TO modify the default demo with some tooty frooty colors.  Yay!  Fun.  A texture sprays the light beams.  Color-up the texture and you color the light beams.  Easy.  Cool toy!  A little FPS-heavy in full-screen mode, but that's part of the fun. 

 

Nice job goes out to the author(s) of our new volumetric light scattering (VLS) system... and the excellent first playground demo.  I didn't author any of it.  I just browsed the documentation and made some easy adjustments.

 

VLS rocks!  I'm excited!  Party on!

 

What's that?  You want one more?  Ok, fine, here you go.  This one is particle-larly interesting.  ;)

Link to comment
Share on other sites

Hi!  Here's a couple more...

Proving that a fire procedural texture... works as a godrays source...

http://playground.babylonjs.com/#QKYUV    (keep clicking RUN for different fire colors)

And proving that a video texture... works as a godrays source...

http://playground.babylonjs.com/#1ELQC1

Isn't it great when all of our cool toys... cooperate with each other?  I think so.  Too good!

Both of these demos are "floor/ground" versions, where a mesh made with CreateGround was used as the 4th parameter in the godrays constructor.  Sorry for the sloppy code, but there are MANY fun knobs to turn in these demos, and I made a happy mess.  :)  Party on!

Link to comment
Share on other sites

What's that you say?  Time for the crème de la crème?  Well, hmm, I suppose.

You knew it had to happen.  Two of my most-recent interests, colliding.  No, I'm NOT using sparkly particles as the source of a godrays.  (yay sparticles!)   But that would be interesting, eh?  Use the particle emitter as the mesh for the godrays, and (maybe) then each particle becomes a godrays source?  Oh my God!  It might not work.  I'll save THAT demented experiment for another day.  :)

Nope, this one uses...  well... take a look for yourself...

http://playground.babylonjs.com/#HYFQJ  (click RUN over and over, prepare for drool floods)  :)

Yep, a Spherical Harmonics shape as a godrays source! This uses Jerome's most advanced CreateRibbon function, which is now part of the framework, but I included its full source in the playground... so we could tweak/break things on it.

Also here... the fantastic fire procedural texture, with its shader included in the playground code!  More things to bend, spindle, and mutilate!

And, of course, all the cool fun and power of our new VLS (Volumetric Light Scattering) system!  Yay!

VLS is a unique feature.  In a way, there are two ways to use it.  (Which is it, Wingy - "a way" or "two ways"?  Geez, Wingy!)  :)

First, use VLS as a "radiator" of volumetric light BEHIND other mesh that occlude/block the god rays.  By default, godrays uses a billboardMode-all plane as the rays radiator.  Easily adjustable.

Second, you could use VLS to make a mesh BE a godray radiator, like the demo above. 

And, of course, you could combine the two ideas.  Think about one SH shape that is radiating godrays, and another (or many) non-radiating shapes... blocking those godrays (creating godray shadows or godray "light wells" - rays of black shadow).  coooool!

There are SO many fun experiments to be done... that start with THIS demo.  Grab a zip, or just start hacking-away in the playground.  HOURS of entertainment!  (It's kind-of bright, isn't it?  Retina tan!)  Be well, party on!

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...