BabylonJS MeshLine - a port of THREE.MeshLine

ohhhhh which playground is it @Pryme8 ? cc @Evgeni_Popov

Its all of them, if I rotate the camera at all from directly at them.

1 Like

I tested several examples from the doc and they all work, even with moving the camera (Window 11 / Chrome).

Would you have a PG for us to test?

Its on all the demos looks like others have been having it happen too.


Basic Demo:


Transformation Demo:

Color Demo:

Its every single one. I have never used it, just seeing it from the examples.

I recognize these lines. This is the example app from the absolute beginning, v0. 0 :joy: You can find the new PGs in the docs. (sry no link, I am on phone). Everyone else is referring to these PGs. Will you pls try out those? Thx!

@sebavan @Evgeni_Popov

EDIT: Creating A GreasedLine | Babylon.js Documentation

2 Likes

Hi @roland. Great job !! . On my side all the PG are ok except the one using GetPointsFromText :
https://playground.babylonjs.com/#H1LRZ3#113
BABYLON.GreasedLineTools.GetPointsFromText is not a function

1 Like

Thank you!

That function was added yesterday, it’ll be available in the PG in the next build of BJS. I think in a few hours it might be online.

my bad, I just saw it’s in the 6.9, online pg is 6.8.1 :upside_down_face:

1 Like

@mawa

I’ve just added a predicate so you can freely manipulate the line points whe converting the mesh to lines or return false to omit the lines:

const predicate = (p1, p2, p3, ix, vx) => {
    if (vx % 4 === 0) {
        return [p1, p2, p3, p1]
    } 
    return false
}

const points = BABYLON.GreasedLineTools.MeshesToLines([sphere], predicate)

Sphere from hellraiser (ballholder, just need two of them) :smiley:

3 Likes

That does it, yeah these ones are not doing it.

1 Like

Yeah finally :joy:

Thank you very much!

And now the PR with the getter / setter approach is waiting to be merged already… To tell you the truth, it’s looking much more BaylonJS-ish :partying_face:

1 Like

image

:joy:

2 Likes

Having fun with greasedLines :smiling_face_with_three_hearts:,

Just wanted to quickly share with you my exhilarating moments discovering your new ‘toy’. Because, for a simple designer like me, this thingy is indeed ‘a new toy’ :boy: :cowboy_hat_face:. I think I’m having the best moments since the introduction of PBRMats or NME or the GUI Editor. Something that offers tons of possiblities without hurting my small designer’s brain :brain: :rofl: (oh, how I just hate Maths and complex things :grin: :dizzy_face:

I’m only getting a grasp of it yet but one thing’s already clear to me: My scene’s main attraction, the ‘giant interactive sphere’ will be based on greased lines. Understand for its structure but also for the fx (of animated glowing lines). I will try my best to give tribute to your work. Hope I won’t f*** it :grin: :face_with_hand_over_mouth: I’m still learning just now. These are my very first steps from this morning :student: but I can already say that all the work you did and with the doc and all PGs is absolutely stunning :star_struck:. I suppose the predicate function is not yet merged (or else, I have been unable to make it work just yet)… NO, don’t reply - I will wait until you are back from your holidays. I have enough to discover for just now. In any case, you sure gave me the desire to finally start working this main feature. And so, greasedLines it shall be :smile:. Enjoy your holidays,
:beach_umbrella: :sunglasses:




4 Likes

@mawa do not go too fast as the API is changing a bit to be more babylon-ish :slight_smile:

1 Like

For once I’m ahead of the others, I’m not gonna hold the horses :joy:
Don’t worry though. I’m keeping it very simple for now. I will make the changes if needed. I’m still just in the ideation phase for this part, so I won’t complain if changes are done (except if you remove the entire feature of greasedLines.forMesh, of course :grin:)

Edit: Slowly moving towards something… just, you know, something :grin:


4 Likes

Sooo Preettty well done @mawa !!!

2 Likes

6 Likes

Wow! So Cool!!! :heart_eyes:

Did you know that you can use this predicate to remove the unnecessary lines from the sphere?

4 Likes

Yes, thx for the info. But I might want to keep with this triangles build. Point is the thumbs will only be shown when interacting with the sphere so they are not always visible. When not, keeping with this more complex structure looks more appealing to the eye (to my eye). But this is all WIP. It’s slowly coming along but it could still change. Nothing final yet but I’m glad you appreciate this first draft :hugs: Have a great day :sunglasses:

2 Likes

Sparks using Dashed GreasedLine Demo:

5 Likes