~ aFalcon: Deep~Dives

GOTTA remember that!

And additional smoothing was SOLVED by @syntheticmagus - with a LOW-PASS-FILTER

How awesome. :pray: Boundless gratitude for any insight to anyone.

Maybe … perfect curves exist afterall???

We will see. :grin:

STATUS: attempting to use the PATH~EDITOR for character path BOUNCE animation… so WE can crash into the planet… of course! And so, really need 10-key-camera…
image
…to view all these tiny points - from every angle - EASILY. TenKeyCam (next)

Looks more like an irregular-heartbeat, for now, but…

GREAT for drawing PATHS in 3DSpace - now new and improved - designed to extend!!!

Including:

  • stretch, point-density, rotation, scale, curves, “anmz” and “camz”: [lookAt, LookUp, ZoomIn, etc].

YES - highly desire EDIT SPLINE in 3D!!!

But I am ONLY a bird.

:bird:

Introducing: TEN-KEY-CONTROLLER

  • have a look. A powerful concept to use 10key in 3D, in multiple MODES. :slight_smile:
    /***********************************- TEN-KEY-CTRL -***********************************\
    - use 10 Key ui to give yourself super powers in BABYLON!!! 
    - use the 5 key to toggle between MODES
    - the MODES (below) are: 'cam','edit','anm', also 'game'  
    - extensible in many ways.
    - example: Alt key changes magnitude of movement, OR direction of rotations, etc-.
    \**************************************************************************************/
    nx.tenKey={mode:'cam'};
    nx.ui.ctrl = {fwd:0,bwd:0,lft:0,rgt:0,up:0,dwn:0,MAGNITUDE:1}
    nx.tenKeyCtrl = function(){
        if(nx.tenKey.nextmode){  //MODE-ITERATOR-.
                if(!nx.tenKey.mode){ 
                    nx.tenKey.mode='cam'
                }else if(nx.tenKey.mode === 'cam' ){
                    nx.tenKey.mode='edit'
                }else if(nx.tenKey.mode === 'edit' ){
                    nx.tenKey.mode='anm'
                }else if(nx.tenKey.mode === 'anm' ){
                    nx.tenKey.mode='cam'
                }
                nx.ui.tenKeyTxt.html(nx.tenKey.mode)
                nx.tenKey.nextmode = 0;
            return;
        }
        //METHOD:-INTERPRET-the-move-by-the-MODE-.
        if(nx.tenKey.mode==='cam'){ //--------------------------------------CAM-.
            //Call cam move on Active-Camera-. //Move-ActiveCam: UP, DWN, LFT, RGT, FWD, BWD.
            var direction = (nx.ui.ctrl.fwd || nx.ui.ctrl.rgt || nx.ui.ctrl.up || nx.ui.ctrl.lookdwn) ? 1 : (nx.ui.ctrl.lft || nx.ui.ctrl.bwd || nx.ui.ctrl.dwn || nx.ui.ctrl.lookup) ? -1 : 0;
            nx.ui.ctrl.MAGNITUDE = (nx.ui.ctrl.alt)? 1 : 10;
            var moveAmount = nx.ui.ctrl.MAGNITUDE * direction;
            var curPos = nx.scene.activeCamera.position;
            nx.scene.activeCamera = nx.cams.freeCam;
            nx.scene.activeCamera.position.copyFrom(curPos); //CAM-MAINTAIN-POS //todo cam maintain frustum
            if(nx.ui.ctrl.fwd || nx.ui.ctrl.bwd){ nx.scene.activeCamera.position.z+=moveAmount; }
            if(nx.ui.ctrl.lft || nx.ui.ctrl.rgt){ nx.scene.activeCamera.position.x+=moveAmount; }
            if(nx.ui.ctrl.up || nx.ui.ctrl.dwn){ nx.scene.activeCamera.position.y+=moveAmount; }
            if(nx.ui.ctrl.lookup || nx.ui.ctrl.lookdwn){ //todo consider turning off state (redundantly) at this level not before or after-.
                moveAmount = 0.1 * direction;
                if(nx.ui.ctrl.alt){ //rotate camera left or right
                    nx.scene.activeCamera.noRotationConstraint=true; //required to rotate cam
                    nx.scene.activeCamera.rotation.y+=moveAmount;
                } else { //rotate camera up or down
                    nx.scene.activeCamera.noRotationConstraint=true; //required to rotate cam
                    nx.scene.activeCamera.rotation.x+=moveAmount;
                }
            }
        } else if (nx.tenKey.mode==='edit') { //EDIT-. //Call edit move on active edit nodes-.
            for(var i = 0; i< nx.activeEditNodes.length; i++){
                var editNode = nx.activeEditNodes[i];
                editNode.editFn(); //Call-Edits-.
            }
        } else if (nx.tenKey.mode==='anm') { //---ANM-.
            if(nx.ui.ctrl.lookup){ nx.ui.ctrl.lookup=0; //call many anm sequences-.
                runSequence("CrashSequence")
            }
        }
    }

Trigger tenKeyCtrl like this:


                //------------------------------------10-KEY-CONTROLS-.
                case 101: //numpad 5KEY - MODEKEY
                    nx.tenKey.nextmode=1; nx.tenKeyCtrl();
                    break;
                //------------------------------------10-KEY-EDITING-.
                case 104://numpad 8FWD
                    nx.ui.ctrl.fwd=1; nx.tenKeyCtrl(); 
                    break;
                case 102://numpad 6RIGHT
                    nx.ui.ctrl.rgt=1; nx.tenKeyCtrl();
                    break;
                case 98://numpad 2BACK
                    nx.ui.ctrl.bwd=1; nx.tenKeyCtrl();
                    break;
                case 100://numpad 4LEFT
                    nx.ui.ctrl.lft=1; nx.tenKeyCtrl();
                    break;
                case 103://numpad 7UP
                    nx.ui.ctrl.up=1; nx.tenKeyCtrl();
                    break;
                case 105://numpad2 9DOWN
                    nx.ui.ctrl.dwn=1; nx.tenKeyCtrl();
                    break;
                case 97://numpad1 
                    // runSequence("CrashSequence")
                    nx.ui.ctrl.lookup=1; nx.tenKeyCtrl();
                    break;
                case 99://numpad3 
                    nx.ui.ctrl.lookdwn=1; nx.tenKeyCtrl();
                    break;
            }    

            if(e.altKey) { nx.ui.ctrl.alt = 1 }
            else { nx.ui.ctrl.alt =  0}

If someone asks, I try PG. :eagle:

Moving on… :heavy_check_mark:

  • With TenKeyCAM, can finish the bounce animation, switching between: anm, cam, and edit - without ever leaving the keyboard!!!

  • The TenKeyCam was needed to precisely make EDITS from many angles: freecam with rotation.

NOTE: publishing the PATH is done with the P key and the code is a STRINGIFY!!!:

    var printRecordedPath = function(){
        console.log('PUBLISH:'); //PUBLISH-RECORD-.
        console.log(JSON.stringify(nx.bouncePath)); //PUBLISH-RECORD-.  
}

Then the EDITED PATH array can be copied from devtools and saved into the member variables…

:black_heart:

Someday, someone will find this thread. Who is like me. That is who it is for…

4 Likes

@nasimiasl - I see your YouTube videos on Geometry Builder. Excellent!

GOAL: How to make SandDunes???

Import CURVE from Inkscape… EPIC!

Then Extrude? Smooth. Material…

Last, Export Geometry?

I’d like to learn. Will try soon…

Thank you,

i work on video with sub title that explain all
that video is GB core
i have GB ver 1 and 2
i start some project after i finish step 1 (in 6 months) i have a perfect tools for Geometry Builder
i dont know we can make it Open but i wanna have free plan for BABYLONJS forum’s members

*** we have GB core in BABYLON.Extensions for now

http://mirror.5kb.me/Petrocad/samples/stp4.html#abcd

1 Like

http://editor.5kb.me/#70153!rim

3 Likes

I wish I understood you more falcon… haha I really feel like you are working on some good stuff sometimes but have trouble deciphering what is going on.

I think as more people get a better idea of what you are doing as you pull it together more an they get a better idea of whats going on there will be more discussion for you to get into.

1 Like

Rock and Roll, Rock and Roll!!! :musical_score:

@nasimiasl and @Pryme8 … you guys are great, your talent is very impressive.

HOLY COW :cow2: everyone → NAS just CRUSHED SandDunes!!!


I knew you could do it! But, even my gamer son is impressed… highest honor. :trophy:

How in the world??? I will try core Extension for GB… today!

Super cool you use INKSCAPE for CURVES. Like. :+1:

…WOW… “Perfect Curves!”

I will try to LEARN and let other people know.


Pryme8, thanks for wise words and encouragements.

I believe BABYLONs best days are AHEAD. :slight_smile:

NOTES for NAS:

geo, PushVertex, MakeFace…

3 doubly-nested for loops?

Scaling Vertices and uvs.

Why twice?

3?


3! MakeFace - i get it.

segments…

pow()???


Dropping into GeometryBase()…

builder() callback function, RECURSIVE through extension! :black_heart: Oh!


Look at that Shader!

What is it doing?

ShaderBuilder. Map . InLine… Sand texture, nice.

  • look at those Dot Products!

.BuildMaterial.

Mesh.material

Then - again with collisions??? Oh, that is interesting!


This 1 shader … is all the beauty:

            .InLine(`float h = 1.-min(1.,max(0.,pow((pos.y-10.)/30.,1.)));
            float fs = dot(nrm,normalize(pos-camera));
             float fs2 = dot(nrm,normalize(pos-vec3(1000.)));
            result.xyz  = min(1.,max(0.,(1.2+fs*0.1+fs2*1.2) )) *result.xyz;
            `)

Is this the SHADOWS? Oh… it is making sense.

  • float, pow, dot, min.

Another Shader…

Reflections on SAND?

  • refract(), atan, SBP

How to wire it up i wonder…

Looks like it needs a scale, so on each vertex, face… uv. :slight_smile:


:baby_chick: …baby chick gets it.



Sand_Dune_HEIGHT:

3! Logarithmic SIMPLEX NOISE algorithms. Nice.

ToRef! I get that now… finally. :sunny:


FOUND THE NUM (in the NOISE) that builds SANDCASTLES:

Surf Around - it is so nice!!!

Sand Mountain

Happy - to be HALF AS GOOD AS NAS… someday. :slight_smile:

(Above) Amazing work by - @nasimiasl

3 Likes

~Impressive levels of Technical Talent and Mathematical Artistry in this community. :eagle:

1 Like

Ha, :wink: not all of my story is public.

2 Likes

Mr. Mysterious!

1 Like

I think it is the “farm animals” thing. :smiley: You don’t want to “pry”.

A picture is only worth a thousand words. A BJS scene… maybe 10,000 words.

Some of my-my-my stories… are 10 million words long!

I would need “cargo art”. :slight_smile:

My attempt at a halfpipe https://www.babylonjs-playground.com/#SQFG0Q#4

This uses function I have been working on over the past couple of weeks or so. More PGs here The Wingnut Chronicles

Will write up some docs over the next few days (or weeks)

2 Likes

AWESOME JohnK!

Looking…

Nice, you didn’t need extrude!


- phi, theta, matrix, rotation.

Cool it TILTS!

  • lean, swivel, subtractToRef, atan2, and *=sign()??

Thank you JohnK for leaving the comments in createSection

Found the ribbon… it is really interesting.

void 0;

The fancy brother of “undefined”? Ok. :slight_smile:

I like it…

Epsilon - limit
Theta - angle
Phi - golden ratio
NURB - non uniform rational basis spline

you have a lot energy aFalcon :wink:

3 Likes

Everyone says falcon is intense.

A person can accelerate or suppress…


Really enjoyed Geometry Builder…

… and that awesome “builder” (recursive callback) PATTERN.

~Deep-Dive: Geometry Builder. : )

2 Likes