- Home /

**closed**Feb 18, 2013 at 04:17 PM by Graham-Dunnett for the following reason:

Question is off-topic or not relevant Nothing to do with Unity

# Surface Intersection of procedural shapes to find vertex normals?

If you have a vertex sitting on a procedural shape, like a perlin mountain/caves or a Sin Cos jellyfish ball, and you wish to sample some points around that vertex's position, not on the mesh itself, but on the function that made the mesh...

What is the Best method to do it??? I think I need 3 points adjacent to the vertex to triangulate the normal?

For example, surface formula "P" perlin(Xq,Yr)*perlin(Zs,t)*sqrt(xx*yy*zz)= 0.400

for the moment i can see these solutions:

A/generate some Lines adjacent to the vertex, and sample the intersection of the lines with formula P, (they have to be equidistant from the vertex?) and take 3 points in that fashion.

B/ make a larger of formula P, = to 0.401 (the surface will be slightly larger/above previous one) and the take the closest point on the second formula, to the vertex on the first one? seems ok but how do i calculate the closest point on the larger formula compared to the vertex?

C/make a sphere formula around the vertex, say 10 pixels diameter, and take three points from the intersection of the sphere and the formula P.

I can see these in theory but i think the maths is difficult! i got an E in advanced maths! is there any code/ theory on about normals from intersections of points with surface formulas? what would be the fastest?

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

Faces on procedural mesh with directional light 0 Answers

Calculate Bounds Intersection Face Normal 0 Answers

Meshes flipping on procedural generation 0 Answers

Procedural Mesh, Strange Clipping 1 Answer