Digital Monet using only Line2D

opencfaopencfa Posts: 2Member
edited August 7 in Art & Design

Greetings and thanks to Godot developers and community. This is my first post to the group An image generated with Line2D and some noise for background.

Here is another image with minor changes in the code.

Comments

  • docdoc Posts: 5Member

    Thats insane, are you using reference imagery somehow or is this procedural?

  • cyberealitycybereality Posts: 1,049Moderator

    OMG, that's amazing!!!

  • opencfaopencfa Posts: 2Member
    edited August 22

    Thank you. This is procedural. Used noise over a modulated TextRect for background. Created a plant using line2d. Then used this to randomly place instances and layers. Also added a button to add more instances.
    The code looks somewhat like this, sorry it is not clean. Godot shows memory leaks. I will create a proper tutorial once I am free.

        extends Node2D
        var plant = preload("res://plantonly.tscn").instance()
        func _ready():
            randomize()
            for i in range (4):
                garden(10.0,-30.0,100.0,40)
    
        func garden(mm,mn,mangle,num):
            var m =mm
            var n = mn
            var angle =mangle
            for i in range (num):
    
                var pl = load("res://plantonly.tscn").instance()
    
                var sc = rand_range(0.01,0.02)
                pl.rotate(sc)
    
                pl.position+=Vector2(m,n)
                pl.scale = Vector2(rand_range(0.2,2.0),rand_range(0.2,2.0))
    
                add_child(pl)
    
                m=rand_range(-100,1400)
                n=rand_range(-10,200)
    
    
        func _on_Button_pressed():
            garden(-10.0,-30.0,100.0,40)
    
Sign In or Register to comment.