Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Noise Functions and Relative Scale

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 483 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 26/06/2010 at 20:31, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.5 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi everyone.

      I would like to scale the noise functions that I am using in the same manner as the relative scale setting in the Noise shader.  Could anyone point me in the right direction for how to accomplish this.

      If you create a material in C4D and add a noise shader to the color channel.  Then go in to the noise shader and set the noise to x = 100 y = 0 and z = 0.   you will see that the noise becomes straight lines.  So each part of the vector adjusts the scale of the noise in each direction.  I want to do the same to the noise functions that I am using on my geometry.

      Any help you could offer would be greatly appreciated.

      Thanks.

      ~Shawn

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 28/06/2010 at 06:39, xxxxxxxx wrote:

        Which noise functions are you using? In general it's just a matter of scaling the individul vector components of the position vector passed to the function.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 28/06/2010 at 06:47, xxxxxxxx wrote:

          Hi Matthias,   right now I am just using Turbulence to test my results...

          Here's what I have..

          for (int i = 0; i < pointCount; i++)
          	{   
          		Real factor=0;
          		
          		Real turbx, turby, turbz;
          		Vector norm = GetVertexNormal(i, polyCube, &nb);
            
          		turbx = Turbulence((points[i] * scale.x + shift.x),time, octaves, abs) * strength;
          		turby = Turbulence((points[i] * scale.y + shift.y),time, octaves, abs) * strength;
          		turbz = Turbulence((points[i] * scale.z + shift.z),time, octaves, abs) * strength;
          			
          		Vector turb = Vector(turbx, turby, turbz);
          		
          		//Turbulence
          		if (bc->GetLong(SPACEROCK_NOISETYPE) == SPACEROCK_TURBULENCE)
          		{
            
          			points[i] = Mix((points[i] * turb) * norm, points[i], amt);
          			
          			//points[i].x = Mix(points[i].x * turbx, points[i].x, amt) * scale.x;
          			//points[i].y = Mix(points[i].y * turby, points[i].y, amt) * scale.y;
          			//points[i].z = Mix(points[i].z * turbz, points[i].z, amt) * scale.z;	
          		}
            
            
            
          	}
          

          The results I am getting are less that impressive.    It looks more like a bumpy ball than a rock.  HAHA

          here's an image.

          When you scale the noise in for example the x component of the vector for a noise shader, you get more ripples than little bumps like I am getting.    Any thoughts on how I could achieve that ripple effect with geometry that is achieved by using a noise shader?

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 28/06/2010 at 09:21, xxxxxxxx wrote:

            What I meant is to scale the vector you pass to Turbulence().

            Something like this:

              
            //the current vertex  
            Vector p = padr[i];  
              
            //relative noise scaling  
            p.x *= scale_x;  
            p.y *= scale_y;  
            p.z *= scale_z;  
              
            //get the scaled turbulence  
            Real t = Turbulence(p, 2, FALSE);  
            

            Use the scaled  turbulence values to move the vertices along their normal for instance.

            cheers,
            Matthias

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 28/06/2010 at 10:05, xxxxxxxx wrote:

              Oh...  now I see.. thanks again Matthias!

              ~Shawn

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 28/06/2010 at 10:24, xxxxxxxx wrote:

                LOL..  it's official Matthias.  You just became my favorite person on the planet.    Two weeks of toying and reading and arguing with code were solved in your last post.   It's amazing what we overlook when we are frustrated.  LOL

                Thanks again.   If I lived anywhere near you I'd buy you a beer.

                ~Shawn

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post