Note that there are some explanatory texts on larger screens.

plurals
  1. POApplying animations to objects in openGL
    primarykey
    data
    text
    <p>I have stumbled upon a problem here while writing a program in which I am animating shapes using openGL.</p> <p>Currently in the program, I am creating some shapes, with the following snippet</p> <pre><code>for(int i=50;i&lt;=150;i=i+50){ for(int j=50;j&lt;=750;j=j+200){ //Draw rectangle shape at position(j,i); //shape has additional capability for animations } } </code></pre> <p>which gives me this output:</p> <p><img src="https://i.stack.imgur.com/bj2Fr.jpg" alt="enter image description here"></p> <p>Now, I have to resize these rectangles and move them all to another position. I have the final target <code>Point</code> for the first rectangle <code>rectangle at position[0][0]</code> where it should be moved. However, when I animate the size of these rectangles with something like</p> <p><code>rectangle.resize(newWidth, newHeight, animationTime);</code></p> <p>the rectangle for obvious reasons do not stick together, and I get something like:</p> <p><img src="https://i.stack.imgur.com/I1VdY.jpg" alt="enter image description here"></p> <p>I am looking for something like <code>Grouping</code> which can bind these shapes together, so that even when different animations like resize (and motion etc.) are applied, the vertices or the boundaries should be touching together.</p> <p>Note that <code>Grouping</code> is the main thing here. I might have a requirement in the future in which I would have to group the two rectangles in the last column, where independent animations (like rotations) already happening on them. So, I picture this something like a <code>plane/container</code> having these two rectangle and that <code>plane/container</code> itself can be animated for position etc. I am fine with algorithm/concept and not the code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload