Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make perlin worms??

Discussion in 'Scripting' started by spacey407, Aug 14, 2022.

  1. spacey407

    spacey407

    Joined:
    Jul 17, 2019
    Posts:
    3
    Does anyone here know how to make 3D perlin worms with code? I've been looking for a way to do it for literal hours and can't find anything!
     
  2. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    Perlin worm

    lol


    Perlin so that the worm is the same everytime a coordinate is reused?

    worm as in I want just one part of the noise from one place of the Perlin map?


    Perlin lol

    don’t make me laugh
     
  3. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    The colour of the integer of the pixel point on the Perlin map is your Y height. The x and y coordinate for your pixel position on the Perlin map is your X and Z location.

    the list of coordinates is vector3 but the pixel map needs an x and z int conversion. You then make the cube or worm on the basis of such data.

    sorry for previous post :D
     
  4. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    You can always make your own huge pixel texture if the Perlin map is not to your liking or is too familiar. Perlin noise map has overhead aswell
    You’ll be lucky because pixels wrap themselves on textures. I think you could get more ideal results using your own colour Perlin map. Each pixel on your texture can add some different Y value. And you can lay it out on x and z.

    Perlin joise can cause crashes. I made a Perlin explorer once and it was horribly unstable.
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If you do not know the answer then do not post. This is not discord, but the scripting forum, so a good reply would be:

    "can you explain what perlin worms are, and what you would like to achieve?"
     
    Bunny83, Reedex and Kurt-Dekker like this.
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    Are you using Google or are you using Bing?!

    Use Google... this is the first response. It includes a full source code package in c++ as well as a discussion about what Perlin worms are.

    http://libnoise.sourceforge.net/examples/worms/

    At a bare minimum you could transcode the C++ into C# and get at least an initial implementation.

    GO!
     
  7. spacey407

    spacey407

    Joined:
    Jul 17, 2019
    Posts:
    3
    Thank you! I didn't see that one at first.
     
  8. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,590
    And in this specific instance not even that. Perlin Worms, just like standard Perlin noise, is a well known term in the area. I know this is nitpicking, but one would also not go to a thread about Perlin noise and ask the thread creator to explain what Perlin noise is first. That`s basically asking someone to explain what the topic is they are talking about, while knowing that should be a prerequisite in order to answer in the first place (unless of course the topic is not clearly stated).
     
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    I've never wormed before and I dunno if I got it correct but this was my attempt, based on a quick scan of the link above. Seems pretty straightforward.

    Screenshot-mw4-133049777976292260.png

    Full package attached.
     

    Attached Files:

    Bunny83 likes this.
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    There are some deleted posts from someone trolling so it may be out of context.
     
    Bunny83, Yoreki and Kurt-Dekker like this.