Jump to content

Bezier Surface


Recommended Posts

I was inspired by this topic to produce a bezier surface. The surface is not a mesh but a logical object that contains the data from which you can build the mesh using a ribbon.

I restricted myself to a bicubic surface. Over the next weeks I will add some other methods and who know perhaps try to write a typescript version and PR it.

This PG animates the surface by changing the control points, https://www.babylonjs-playground.com/#KT9EE7#1

In this PG you can move the control points (purple spheres) in the direction of the chosen axis. Click on a control to move the axes to that control, click on a cone to set the axis along which you move  the control ( done by giving mesh behaviours a go) then drag the control https://www.babylonjs-playground.com/#KT9EE7#2

Work still in progress. have fun.


Link to comment
Share on other sites

1 hour ago, NasimiAsl said:

** move in z direction not worked for me

Had a look and it seems to depend on viewing angle whether an axis works or not. I expect it has something to do with my incomplete understanding of using dragBehaviors

After further reading and digesting what it said I have simplified the PG https://www.babylonjs-playground.com/#KT9EE7#3

NOTE: In new PG since no axis or plane is defined then ` Dragging will occur along the plane facing the camera `.

Thank you for spurring me on to check again.

Link to comment
Share on other sites

53 minutes ago, Arte said:

Spheres not selectable If points underneath the mesh.`

If you change camera view so that mesh not in front of them you can select again. First time with dragging behavior. Probably much better ways to interact with controls but wanted to give new methods a go and get a quick demo up and running. Any improvements welcome.

Working on multi surfaces at the moment.

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.

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.


  • Recently Browsing   0 members

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