Page 1 of 1

### Need some help with scatter normal

Posted: Sat Sep 14, 2019 7:56 pm
Hello,

I am trying to get a scattered item to partially follow the underlying normals of the geometry it is scattered on.

Specifically, as a simplified example, assume I have a sphere and I want to scatter a plane onto each poly of the sphere. In this particular case I want the plane to follow the normals of each polygon ONLY so that it radiates out from the Y axis (in other words, the rotation around Y is affected by the underlying normals of the sphere, but the X and Y rotations are not touched). Essentially I would have a bunch of planes radiating out from the center of the sphere such that they rotate in Y, but are absolutely flat in the XZ plane.

I assume that I have to control the scatter normal somehow, but here is where my vector math skills somewhat fail me. I tried to take the normal of the object (Utility Node), multiply the Y value by 0, and then plug it into the scatter normal. This works in the sense that I no longer get the planes tilting off of the XZ plane. But I also get a local rotation around the local Z axis. Is there any way to control this? Or any other way of achieving this goal?

Ultimately the purpose is to scatter leaves on geometric surfaces, but to have these leaves maintain a more naturalistic orientation with regard to the ground (leaves are generally biased towards the horizontal).

Any thoughts on how to achieve this functionality?

Here is an example file:

Code: Select all
`#Isotropix_Serial_Version 1.2#Isotropix_Clarisse_Version 4#Isotropix_Clarisse_Project_Version 0.94Context "scatter_source" {    #created 1568485943    GeometryPolygrid {        name "polygrid"        #version 0.9        #created 1568484948        #modified 1568486048        positions "project://scatter_source" 0 0        translate 0.147785127918115 0.0 0.0        rotate 0.0 0.0 0.0        scale 0.296959425095706 0.1 0.1        uv_maps "parametric"        uv_maps_loaded yes        shading_groups "grid"        materials "project://default/material"        clip_maps ""        displacements ""        sg_shading_variables ""        visibles yes    }    GeometryPolygrid {        name "polygrid1"        #version 0.9        #created 1568485983        #modified 1568486038        positions "project://scatter_source" 0 0        translate 0.245964113533917 0.0 0.0615875884596486        rotate 0.0 40.4149070114258 0.0        scale 0.2 0.1 0.0411624251683371        uv_maps "parametric"        uv_maps_loaded yes        shading_groups "grid"        materials "project://default/material"        clip_maps ""        displacements ""        sg_shading_variables ""        visibles yes    }    GeometryPolygrid {        name "polygrid2"        #version 0.9        #created 1568486016        #modified 1568486038        positions "project://scatter_source" 0 0        translate 0.245964113533917 0.0 -0.060155451032941        rotate 0.0 -36.8795928850683 0.0        scale 0.2 0.1 0.0411624251683371        uv_maps "parametric"        uv_maps_loaded yes        shading_groups "grid"        materials "project://default/material"        clip_maps ""        displacements ""        sg_shading_variables ""        visibles yes    }    SceneObjectCombiner {        name "combiner"        #version 0.9        #created 1568486055        #modified 1568486233        rotate 0.0 0.0 90        objects "polygrid" "polygrid1" "polygrid2"    }}Context "LOOK_AT_THIS_CONTEXT" {    #created 1455809270    colortag "red"    SceneObjectScatterer {        name "scatterer"        #version 0.93        #created 1568483502        #modified 1568486079        geometry_support "point_cloud_PRIMITIVE_CENTERS"        geometry "project://scatter_source/combiner"        collision_object ""        probability 1        id 0        scatter_normal {            value 1 1 1            texture "multiply_REMOVE_Y_COMPONENT_OF_NORMAL"        }        scatter_rotation 0.0 0.0 0.0        scatter_rotation_variance 0.0 0.0 0.0    }    TextureMultiply {        name "multiply_REMOVE_Y_COMPONENT_OF_NORMAL"        #version 0.9        #created 1568483607        #modified 1568486879        input1 {            value 1 1 1            texture "utility_EXTRACT_GEO_NORMAL"        }        input2 1 0.0 1    }    TextureUtility {        name "utility_EXTRACT_GEO_NORMAL"        #version 0.9        #created 1568483527        #modified 1568486144        output 2    }    GeometryPolysphere {        name "BASE_GEOMETRY"        #version 0.9        #created 1568485858        #modified 1568486286        uv_maps "parametric"        uv_maps_loaded yes        shading_groups "surface"        materials "project://support/matte"        clip_maps ""        displacements ""        sg_shading_variables ""        visibles yes        spans 16 7    }    GeometryPointCloud {        name "point_cloud_PRIMITIVE_CENTERS"        #version 0.91        #created 1568483451        #modified 1568485893        uv_maps "parametric"        uv_maps_loaded yes        shading_groups "points"        materials "project://default/material"        clip_maps ""        displacements ""        sg_shading_variables ""        visibles yes        distribution 4        point_count 100        geometry "BASE_GEOMETRY"    }}Context "support" {    #created 1568487172    MaterialMatte {        name "matte"        #version 0.91        #created 1568483570        #modified 1568485197        positions "project://support" 0 0        color {            value 0.0 0.0 0.0            texture "project://LOOK_AT_THIS_CONTEXT/multiply_REMOVE_Y_COMPONENT_OF_NORMAL"        }    }}`

### Re: Need some help with scatter normal

Posted: Mon Sep 16, 2019 9:51 am
Hi,

Object orientation could be defined by a vector AND an up vector. A vector alone can't define a proper orientation as the object can have several rotation values on the Y-axis. I don't know how to solve your problem but I guess you'll have to texture the scatterer rotation Y-axis to counter those nearly random rotations.

Cheers

### Re: Need some help with scatter normal

Posted: Thu Sep 19, 2019 7:32 pm
Thanks.

I'm afraid that defining this map would be very difficult for me to figure out.

I'll make a feature request for this, but if anyone has any thoughts on how to accomplish this (or even what the math would be to create this texture to control the Y-axis rotation) I would greatly appreciate it.