addpoint not adding points

   1196   1   0
User Avatar
Member
6 posts
Joined: March 2017
Offline
Hi There,

Most probably a really simple answer, I have been following along with the tutorial below:
https://www.youtube.com/watch?v=_xIMLjSx9QQ [www.youtube.com]

And everything works except the new point generation. Is there something glaringly obvious with the code below that I am doing wrong? everything else works, the generation of points at the beginning etc.
int pointCloud = pcopen(0, 'P', @P, 1, 50);
vector localCentre = pcfilter(pointCloud, 'P');
vector v = set(@P.x - localCentre.x, @P.y - localCentre.y, @P.z - localCentre.z);

@P += v * 0.5;

if(@age > 1){
    vector randOffset;
    randOffset.x = -0.01 + (noise(localCentre.x + $FF *@age) * 0.02);
    randOffset.y = -0.01 + (noise(localCentre.y + $FF *@age) * 0.02);
    randOffset.z = -0.01 + (noise(localCentre.z + $FF *@age) * 0.02);
    
    int newPoint = addpoint(geoself(), @P + randOffset);
    @age = 0;
    
}
else{
    @age =+ abs((random($FF + @ptnum)) * 0.05);  

}

Setup:
Houdini 17.5.360 windows

Cheers
Iskander
Edited by iskander_mellakh - Sept. 16, 2019 16:46:25
https://www.icmstudios.co.uk/ [www.icmstudios.co.uk]
Support our project: https://www.fallenmeteor.com/ [www.fallenmeteor.com]
User Avatar
Member
37 posts
Joined: Aug. 2015
Offline
One thing i caught in his video is right at the start; He says to “slide the point number to zero” but then sets it to 1 without saying it. This is important because the wrangle code in the solver runs over points, so if there is not at least one point, the wrangle will do nothing.
  • Quick Links