Jump to content

Add Vertex to Prim


CinnamonMetal

Recommended Posts

I guess you should not squeeze functions into one another (eg point() into lerp()). This works in a primwrangle:

float slide = chf('slide');
int prim_pts[] = primpoints(0, @primnum);
vector pt_pos_0 = point(0, "P", prim_pts[0]);
vector pt_pos_1 = point(0, "P", prim_pts[-1]);
vector pos = lerp(pt_pos_0, pt_pos_1, slide);
int pt = addpoint(0, pos);
int midpoint = addvertex(0, @primnum, pt);

 

  • Thanks 1
Link to comment
Share on other sites

I was already storing the primVertices in an array followed by getting the index of two of the primitives vertices and storing them in a variable.

vector pt_pos_0 = point(0,"P",vp1);
vector pt_pos_1 = point(0,"P",vp2);

Since I'm using a variable from what I know I can't use -1; then followed linear interpolation etc.  The problem is the vertex order is not consistent as in it changes causes the object to have it's normals all inside and out in the viewport ?

Link to comment
Share on other sites

My previous post didn't make much sense :mellow:

When adding a vertex to a primitive, this is the result; rather then the vertex added to the primitive while keeping the normals in tact, unless this is expected in shaded mode ?

Is it possible to re-position the vertex before it's essentially baked onto the primitive ? The slide parameter re-positions the vertex which alters the primitive.

 

 

vertexissue.png

Edited by CinnamonMetal
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.

Guest
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.

×
×
  • Create New...