Steven991 Posted June 27, 2019 Share Posted June 27, 2019 Hello, I'm trying to replicate a Procedural Cake I've seen in this video: To make the basic structure I've created a line with a pscale gradient attribute on each point. Then with a For Each Point loop I copy a cylinder (wich is already scaled in height of the distance between the line points) to the points. The problem is that I want that each layer scales in X and Z according to Pscale, but this is scaling me also the Y of each copied cylinder, which I don't want, as they have to be all the same size (and before copying them they have the right Y). Any ideas on how I can do this? Thank you very much! Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted June 28, 2019 Share Posted June 28, 2019 Hello, you can use vector (float3) point attribute "scale" instead of float point attribute "pscale" which give you non-uniform scale. Set y component to 1 and x and z whatever you need. Here more information about point attributes for copying: https://www.sidefx.com/docs/houdini/copy/instanceattrs.html Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted June 29, 2019 Share Posted June 29, 2019 (edited) Here is another method of copy-stacking any kind of object on top of itself. After sorting line points by height you can toggle between keeping proportions and a custom ramp shape (left). vector pos_next = point(0, 'P', @ptnum + 1); float height = pos_next.y - v@P.y; float grad = 1.0 - ( @ptnum / float(@numpt - 1) ); float radius = chramp('shape', grad); if(chi('proportion_keep')){ v@scale = vector(height); } else{ v@scale = set(radius, height, radius); } if(@ptnum == @numpt - 1){ removepoint(0, @ptnum); } Incoming objects are scaled to unit size with 1/$SIZEY and floored with -$YMIN in a transform node before copying. stacked_copies.hipnc Edited June 29, 2019 by konstantin magnus 3 Quote Link to comment Share on other sites More sharing options...
Steven991 Posted June 30, 2019 Author Share Posted June 30, 2019 Thank you very much! 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.