# Color lines for terrain/landscape generation

**URL:** <https://discourse.processing.org/t/color-lines-for-terrain-landscape-generation/39422>\
**Category:** Coding Questions\
**Created:** [October 25, 2022, 10:49am UTC](https://discourse.processing.org/t/color-lines-for-terrain-landscape-generation/39422 "2022-10-25T10:49:35Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 30, 2022, 12:01pm UTC](https://discourse.processing.org/t/color-lines-for-terrain-landscape-generation/39422/14 "2022-10-30T12:01:09Z")

</div>

Hello @crv74,

> [@crv74](#):
>
> I assume that at this point _ **we** _ could start tilting over the 3D space and paintin lines, right?

Yes. You can use stroke(), fill(), texture()…

Code below will center and rotate grid in previous post.

> **Code \< Click here!**
>
> ```auto
> void setup()
> {
> size(400, 400, P3D);
> //ortho();
> }
> 
> void draw()
> {
> background(0);
>   
> strokeWeight(2);
> noFill();
>   
> line(0, height/2, width, height/2);
>   
> float angle = frameCount*TAU/360;
> 
> translate(0, height/2, -200);
> rotateX(angle);
> translate(0, -height/2);
>   
> stroke(255, 255, 0);
> rect(50, 50, width-100, height-100);
> }
> 
> ```

> [@crv74](#):
>
> “Could” we implement this kind of mesh in 3D with lighting and cameras, so the light falloff does the same trick (darker to the outsides)?

These questions are explored in many topics throughout the forum.

Simple example I wrote a while back:  
[https://discourse.processing.org/t/3d-mesh-of-sine-waves-from-coding-challenge/22806](https://discourse.processing.org/t/3d-mesh-of-sine-waves-from-coding-challenge/22806)

An advanced example:  
[https://discourse.processing.org/t/triangle-strip-lighting-problem/38348/10](https://discourse.processing.org/t/triangle-strip-lighting-problem/38348/10)

A p5.js example:

> [@Sketch runs slow in P5.js WEBGL, (SOLVED by using P5.Geometry)](https://discourse.processing.org/t/sketch-runs-slow-in-p5-js-webgl-solved-by-using-p5-geometry/31990/22):
>
> Thanks, Paul. I knew I had to assign to each gid, but I tried this.gid = ‘nut’+str(id++); instead of this.blendMesh.gid = ‘nut’+str(id++); so that didn’t work. I have been ill for quite some days, but since yesterday I feel better and I decided to design “the enemy”, to look straight in its face. I used .obj files made by drawing vertexes in P5.java exporting them with a really good Processing library called OBJExport. Its not included in Processing’s “Contribution Manager”, but you can …

Many more examples in the forum as well. Many more!

I encourage use to peruse the forum and bookmark the useful posts.

> [@crv74](#):
>
> I know i enter deep waters, and i don’t even know if its possible to.

Deep waters! But they can be navigated.

Lots of resources here:

> **[Welcome to Processing!](https://processing.org/)**
>
> Processing is a flexible software sketchbook and a language for learning how to code. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology…

`:)`

---

_[View the full topic](https://discourse.processing.org/t/color-lines-for-terrain-landscape-generation/39422)._
