This maybe be the most newbie question of the day.
The boiled down version: I want to display a photograph. Before I display it I want to draw a line, top to bottom, through the image. The line won’t be changing. Then I want to rotate the image 9with the line still there, rotating with the image but not updating otherwise).
I can’t get the line to draw on the image–I can get it to draw on the background but not the image. I think I have some fundamental misunderstanding of loadPixels/updatePixels…or something…
Would someone mind sharing a brief bit of code to do this?
Just to make my needs a little more “real world”–I actually need to draw many lines, perhaps hundreds, and so I think I should be doing this in the setup section(?). Likewise, since I will rotate the image I’m worried that this line drawing process will be visible to the viewer and will take up computer resources if I do it in the draw loop. So basically I need to prepare the image ahead of time.
But I’m not asking someone to write my code for me! :). I just need need to figure out the basic task of drawing a line on the image and making it part of the image rather than having to update that same, unmoving line each time.
Hi Darin.
It’s still not clear to me what you want.
You want fixed (not rotating) lines on a rotating image?
That would be like Chrisir said, first image than line, in draw().
I recommend to study following text here
Just to start try to understand thefollowing code:
Hi @Chrisir
How to draw lines within a shape with image texture?
Wouldn’t it be easier to draw the image then lines and then get() the image in setup()?
Yes, I looked at it and googled a bit, seeing if it would work fo my needs. In the end I was worried about it having to redraw each iteration–in my project I might have to draw 2000 lines per photo and might have six or more photos going on at the same time–seems like I would just be asking for trouble doing it in the draw loop.
@darinb You know Chrisir actually meant PGraphics and not PShape don’t you? This confused me a lot. So at the end, do you need a rotating image with still standing lines like I coded above, or are the lines on the images rotating along? In the last case, as Chrisir suggested you can use PGraphics in the setup() that is actually build for this. I don’t think that the computer’s processor will have any trouble to handle this.