Discuss Scratch

PullJosh
Scratcher
1000+ posts

Non-photorealistic rendering projects

gtoal wrote:

This isn't NPR but it's still genuine fake art :-)

Needs to generate piet programs.
Layzej
Scratcher
100+ posts

Non-photorealistic rendering projects

gor-dee wrote:

I'll give fifty waffles to the first person to make a 3D gtoal!

Well, it ain't gtoal, but this one's got to be worth a waffle or two: https://scratch.mit.edu/projects/20883345/
gor-dee
Scratcher
1000+ posts

Non-photorealistic rendering projects

PullJosh wrote:

gor-dee wrote:

Oh, and if you can combine it with @TheLogFather 's Head tracking https://scratch.mit.edu/projects/72290026/ so you can wear the mask on your own shoulders……………
While we're at it, why not let people save their heads in the cloud for other people to put on?
Nice
gor-dee
Scratcher
1000+ posts

Non-photorealistic rendering projects

gtoal wrote:

gor-dee wrote:

I have a challenge for you guys……….
a while ago I was looking at combining a 3D wireframe face (https://scratch.mit.edu/projects/17481405/ by @SohCahToa314) with a Picture scanner like https://scratch.mit.edu/projects/66980580/ by @Layzej and a triangle filler to make a 3D face mask. I'm afraid to say I gave up at the first hurdle but I still think it would be cool. I'll give fifty waffles to the first person to make a 3D gtoal!

Gets my vote :-) Can you do it WPAP style?
Whatever you like!
gor-dee
Scratcher
1000+ posts

Non-photorealistic rendering projects

Layzej wrote:

gor-dee wrote:

I'll give fifty waffles to the first person to make a 3D gtoal!

Well, it ain't gtoal, but this one's got to be worth a waffle or two: https://scratch.mit.edu/projects/20883345/
Your (10) waffles have been delivered
gtoal
Scratcher
1000+ posts

Non-photorealistic rendering projects

gtoal wrote:

The paper http://www.cs.umsl.edu/~kang/Papers/kang_npar07_hi.pdf describes how to calculate an “Edge Tangent Field” which represents the directionality of lines in an image. This is probably too hard to calculate in Scratch but I link to C code that will let you calculate it externally.



In https://scratch.mit.edu/projects/72618266/ there is an image which encodes the X/Y vector at each point, and its magnitude, in the R,G,B values of each pixel. It could be used, for example, in selecting the direction of brush strokes in a painting. (Subtract 128 from the R & G values to get the X and Y vector components)

Here's quite a good paper: http://bit.ly/parse2paint Incidentally Figure 3b in the document (click on the ‘paper and slides’ tab) is the same Edge Tangent Field as above. Also there are some good paint stroke images in there you can use. (though I wish they'd published their entire stroke library)

I like Layzej's latest test ( https://scratch.mit.edu/projects/72769712/ ) - I'm tempted to actually paint over this one and see how it comes out on paper. (I built one of these: http://www.instructables.com/id/Building-and-testing-the-optical-apparatus-from-Ti/ - you can see mine in the Comments section)

G
BookOwl
Scratcher
1000+ posts

Non-photorealistic rendering projects

Not sure if this counts, but…
https://scratch.mit.edu/projects/24658312/
It creates art by randomly stamping a lot of different colored and sized squares on the screen.
gtoal
Scratcher
1000+ posts

Non-photorealistic rendering projects

BookOwl wrote:

Not sure if this counts, but…
https://scratch.mit.edu/projects/24658312/
It creates art by randomly stamping a lot of different colored and sized squares on the screen.
Yeah, put it in for now.
BookOwl
Scratcher
1000+ posts

Non-photorealistic rendering projects

gtoal wrote:

BookOwl wrote:

Not sure if this counts, but…
https://scratch.mit.edu/projects/24658312/
It creates art by randomly stamping a lot of different colored and sized squares on the screen.
Yeah, put it in for now.
Thanks!
novice27b
Scratcher
1000+ posts

Non-photorealistic rendering projects

Slightly off topic, but I'm testing a pen-based rendering technique that I call “adaptive quality”. The image increases in detail over time, and the rate of increase is dependent on your hardware, maintaining a smooth framerate.

http://phosphorus.github.io/#71252892
https://scratch.mit.edu/projects/71252892/
gtoal
Scratcher
1000+ posts

Non-photorealistic rendering projects

novice27b wrote:

Slightly off topic, but I'm testing a pen-based rendering technique that I call “adaptive quality”. The image increases in detail over time, and the rate of increase is dependent on your hardware, maintaining a smooth framerate.

http://phosphorus.github.io/#71252892
https://scratch.mit.edu/projects/71252892/

Probably MartinBraendli's circle-based video thread (or start a new one) is the appropriate place to discuss this. It does look like something he could adapt to his technique (if his circles were drawn in the appropriate order. Then just stop early at frame cut-off time - an easy mod)
Zro716
Scratcher
1000+ posts

Non-photorealistic rendering projects

I have no idea what I was coding but this is the result

gtoal
Scratcher
1000+ posts

Non-photorealistic rendering projects

Zro716 wrote:

I have no idea what I was coding but this is the result


Let's call it a pencil sketch…
liam48D
Scratcher
1000+ posts

Non-photorealistic rendering projects

gtoal wrote:

Zro716 wrote:

I have no idea what I was coding but this is the result


Let's call it a pencil sketch…
A rather good one at that!
chooper100
Scratcher
500+ posts

Non-photorealistic rendering projects

This is an idea I had for non-photorealistic rendering that I don't want to do myself but one you might be interested in:

@Layzej has created a fill-by-triangle project. However, it requires the user to draw the triangles and they are allowed to overlap. I have a solution which will always divide it into non-overlapping convex polygons.

First, we use this code to generate a series of random lines across the screen:
setpencolortosetpensizeto2repeat7gotox:-240y:pickrandom-180to180pendowngotox:240y:pickrandom-180to180penuprepeat7gotox:pickrandom-240to240y:-180pendowngotox:pickrandom-240to240y:180penup
This gives us something like this:


Then, we can use the line intersection finder project by @gtoal to get the coordinates for each vertex on the screen.

The hard part is then figuring out which vertices belong to which polygon. Although I don't know how this would be done I am sure there is a way.

After that, we find the average color in each polygon. I believe that the project by Layzej I mentioned earlier can already get the average color of triangles. What we can do is use the code described in this wiki article to split it up into triangles to scan individually and then take the average of.

Finally, we can use the raster polygon filler by @DadOfMrLog to fill in the shapes.

Anyone interested in tackling this?
liam48D
Scratcher
1000+ posts

Non-photorealistic rendering projects

Somebody should totally make that @chooper.
chooper100
Scratcher
500+ posts

Non-photorealistic rendering projects

liam48D wrote:

Somebody should totally make that @chooper.
Ikr?
MartinBraendli
Scratcher
86 posts

Non-photorealistic rendering projects

The hard part is then figuring out which vertices belong to which polygon. Although I don't know how this would be done I am sure there is a way.
@Finlay_Cool did something like that, but outside of Scratch. In his project FMV using Pen he linked the source to his program (written in C/C++) that splits an image into non overlaping triangles. If anyonoe wants to do this, this might be good reference.
chooper100
Scratcher
500+ posts

Non-photorealistic rendering projects

Yeah, I saw that. Unfortunately C / C++ isn't my strong point so I can't do anything with the source code.
Layzej
Scratcher
100+ posts

Non-photorealistic rendering projects

I've been trying to approximate a picture with triangles using a genetic algorithm. Unfortunately it has not been a screaming success: https://scratch.mit.edu/projects/70172336/

Powered by DjangoBB