<p>What algorithm can i use to pull entere area?</p>
<p>i have this image:</p>
<p><a href="https://i.sstatic.net/xhsyf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xhsyf.png" alt="enter image description here" /></a></p>
<p>are there many algorithms, which algorithm can you recommended me to implement?</p>
<p>Edit 1:</p>
<p>my square was builded with lines (bresenham), i want to move to up in the Y axis (i am working without libraries, only math and java, i am using putpixel(x,y))</p>
<p>i want to create this:</p>
<p><a href="https://i.sstatic.net/i58Bh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/i58Bh.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2020-09-05T08:55:02.860Z
This question can not be adequately answered. First we do not know what the modeling famework your using to make a square, we do not know what you want the end result to be.
joojaa
CC BY-SA 4.0
2020-09-05T16:13:17.250Z
As joojaa already mentioned, your question is too unspecific to give you a qualified answer. Please use the edit button to add more details. If I got you correctly, you want to automatically identify the borders of an arbitrary area and move it around, right? We still need to know in which form you work with your data (just pixel? parametric lines/curves? other?)
wychmaster
CC BY-SA 4.0
2020-09-05T20:43:35.830Z
@wychmaster i edited my question
hubman
CC BY-SA 4.0
2020-09-05T20:47:19.633Z
i think you can use a tranformation in any axis, x, y or z, in this specific case is Y,
information
CC BY-SA 4.0
2020-09-06T11:37:01.680Z
Bresenham is just an algorithm to draw all pixels of a line defined by some parameters. So the approach would be to modify the parameters of the affected lines (for example increasing the y-values of the start and endpoint), clear your canvas, and redraw all lines (including the ones that didn't move). This is usually how graphic APIs like OpenGL and DirectX do it. You don't move the pixels in an existing image. You simply redraw it. So you need to store the parameters of all your drawn objects, update them if needed, and redraw everything if something changes.
wychmaster
CC BY-SA 4.0
2020-09-06T12:08:11.400Z
Do you need to be able to rotate the camera or objects? Or will you always look at those from a specific direction/finite set of directions?
lightxbulb
CC BY-SA 4.0
2020-09-07T08:22:01.277Z
Please edit your question to clarify what exactly you want to achieve. Read through the comments to get some impressions of what additional information might be necessary to understand what you are asking. If you need help, feel free to contact me [in our chat](https://chat.stackexchange.com/rooms/26589/the-cornell-box) - We can reopen the question as soon as the missing details are added.
wychmaster
<algorithm>
How can I pull up the whole area of the square?
hubman
# How can I pull up the whole area of the square?

(Asked by: username_0 on 2020-09-04)

What algorithm can i use to pull entere area?

i have this image:

[![enter image description here](https://i.sstatic.net/xhsyf.png)](https://i.sstatic.net/xhsyf.png)

are there many algorithms, which algorithm can you recommended me to implement?

Edit 1:

my square was builded with lines (bresenham), i want to move to up in the Y axis (i am working without libraries, only math and java, i am using putpixel(x,y))

i want to create this:

[![enter image description here](https://i.sstatic.net/i58Bh.png)](https://i.sstatic.net/i58Bh.png)

**Tags:** algorithm

> **Comments:**
> **username_1**: This question can not be adequately answered. First we do not know what the modeling famework your using to make a square, we do not know what you want the end result to be.  
> **username_2**: As username_1 already mentioned, your question is too unspecific to give you a qualified answer. Please use the edit button to add more details. If I got you correctly, you want to automatically identify the borders of an arbitrary area and move it around, right? We still need to know in which form you work with your data (just pixel? parametric lines/curves? other?)  
> **username_0**: @username_2 i edited my question  
> **username_3**: i think you can use a tranformation in any axis, x, y or z, in this specific case is Y,  
> **username_2**: Bresenham is just an algorithm to draw all pixels of a line defined by some parameters. So the approach would be to modify the parameters of the affected lines (for example increasing the y-values of the start and endpoint), clear your canvas, and redraw all lines (including the ones that didn't move). This is usually how graphic APIs like OpenGL and DirectX do it. You don't move the pixels in an existing image. You simply redraw it. So you need to store the parameters of all your drawn objects, update them if needed, and redraw everything if something changes.  
> **username_4**: Do you need to be able to rotate the camera or objects? Or will you always look at those from a specific direction/finite set of directions?  
> **username_2**: Please edit your question to clarify what exactly you want to achieve. Read through the comments to get some impressions of what additional username_3 might be necessary to understand what you are asking. If you need help, feel free to contact me [in our chat](https://chat.stackexchange.com/rooms/26589/the-cornell-box) - We can reopen the question as soon as the missing details are added.  

---

## 0 answers

