Triangulate surface in 3D-space - algorithm

I have a set of points(x,y,z) in space and from them i need to create a surface and triangulate it. In theory it should be something like parametric-generated surface.
I have tried projecting points on 2d, triangulate it and put it back in 3D, but this doesn't work for me, also tried few algoritms but main problem, that i have is all of them gives back polyhedron-shaped object, but my goal surface-shaped triangulated object. I need some help with algorithms/different approach to problem

You need to implement BallPivoting, give a look to: http://www.research.ibm.com/vistechnology/pdf/bpa_tvcg.pdf

Related

Instancing - See Through 3D Objects

I have been trying to instance some tree meshes in react-three-fiber and threejs,
this is what i have got so far: https://codesandbox.io/s/silly-sunset-74wmt?file=/src/App.js
The trees from one angle look see through, I am able to see the barks of ALL trees.
but the behavior is normal from the opposite angle.
To me it seems to be some issue with render order or meshes or the shader, not able to wrap my head around it.
I need the see-through thing to not happen and the set should look like how it looks like in the second picture from all angles
As suggested in the comments byDon McCurdy. I needed to use AlphaClip property on blender while exporting my mesh.
Found an answer here which was quite helpful in understanding the problems with threejs transparency at play
Updated with the solution: https://codesandbox.io/s/silly-sunset-74wmt?file=/src/App.js

Drag an object along a bezier curve using ThreeJs

Using threesJs. I'm trying to move an object along a bezier curve (idealy beziercurve3).
My purpose is to move a little point by mouse and then after use this point to cut this curve in two,
or start an other curve3 attached to this point.
From what I search before I suppose I should use something like clamp_to_curve function.
I saw that Line3 got closestPointTPoint Is it a good idea to do the same with a bezier curve?
Maybe getPoint and getPointAt from curve can help but I don't know how to use them. After searching for a while I fill a little bite lost.
What is the best way to start this ?

Determine whether a point is above a mesh surface with PCL

How can I determine whether a point is above an irregular mesh/surface in PCL?
I have one cloud of points that I would like to convert to a surface/mesh (not sure which terminology I should use.) Think of it as an irregular ground plane. For example:
This just shows that the surface can be sort of random, even have holes in it where data wasn't available.
Now, I have another point cloud, and I'd like to be able to filter out all the points that are below this surface.
The way I've been converting my points to a surface was by following the Fast triangulation of unordered point clouds tutorial.
If I can do this without converting the points to a surface, that would be great too. I'm new at this so I can easily imagine I'm going about this all wrong.
When I tried using straight point clouds, sparsity became a big issue. For example, in the image below, I generated a dense surface of points, and to filter the other cloud, used used getPointsInBox() (as suggested here) to search beneath the points. But as you can see, it fails with sparsity (the blue points circled in black.)
If I could create a more-or-less continuous mesh grid of points from my original points, the getPointsInBox() method would work quite well, but I also haven't been able to figure out how to do that.

How to rotate a model on a plane?

I am using a plane geometry to represent a terrain model with different "y" values(altitude). Also using the raycaster function I am able to move the model on the plane.
I need a way to rotate the model a be parallel with the current face its on without changing its path orientation.
Is there a way to define rotation by a face of a geometry?
theCorrect me if I'm wrong here, it sounds like you want to have both local (on the face) and global (in the direction of your "path orientation") rotations integrated here. This is, in general, one of those tricky and somewhat context-specific problems that will require you to mix two different sources of rotation. In a typical Euler-style rotation, it sounds like you want to rotate around Y according to the path (I'm assuming the path is in top-down 2D here -- it's these assumptions tat make the problem impossible to definitively answer!), while rotating around X and Z according to the normal of the surface. Try taking assembling a THREE.Euler that way -- does it get you in the neighborhood?

Is there a common technique for drawing a "stretchy" line

I'm trying to figure out how to draw an stretchy/elastic line between two points in openGL/Cocos2d on iPhone. Something like this
Where the "band" get's thinner as the line gets longer. iOS uses the same technique I'm aiming for in the Mail.app, pull to refresh.
First of all, is there a name for this kind of thing?
My first thought was to plot a point on the radius of the starting and ending circles based on the angle between to the two, and draw a quadratic bezier curve using the distance/2 as a control point. But I'm not a maths whizz so I'm struggling to figure out how to place the control point which will adjust the thickness of the path.
But a bigger problem is that I need to fill the shape with a colour, and that doesn't seem to be possible with OpenGL bezier curves as far as I can tell since curves don't seem to form part of a shape that can be filled.
So I looked at using a spline created using a point array, but that opens up a whole new world of mathematical pain as I'd have to figure out where all the points along the edge of the path are.
So before I go down that rabbit hole, I'm wondering wether there's something simpler that I'm overlooking, or if anyone can point me towards the most effective technique.
I'm not sure about a "common" technique that people use, other than calculating it mathematically, but this project, SlimeyRefresh, is a good example of how to accomplish this.

Resources