CinnamonMetal Posted April 29, 2018 Share Posted April 29, 2018 vector midpoint = addvertex(geoself(),0,lerp(point(0, "P", vp1), point(0, "P", vp2), 0.5)); I want to add a vertex to the primitive, but I'm not seeing an extra vertex on the primitive ? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 29, 2018 Share Posted April 29, 2018 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); 1 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted April 29, 2018 Author Share Posted April 29, 2018 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 ? Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted April 30, 2018 Author Share Posted April 30, 2018 (edited) My previous post didn't make much sense 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. Edited April 30, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 30, 2018 Share Posted April 30, 2018 Normal SOP. 1 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted April 30, 2018 Author Share Posted April 30, 2018 (edited) Thanks for everything Edited April 30, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.