Can We Do This Together? (Two robots in a bar)

I’m newbie on processing 3. I decided create a scene with experienced people (so you). Can we do this task together step-by-step? If you help me, I will glad.

In 3D animation. Two guys drink coffee
1 table, 2 chairs, 2 stick man… And also, 2 mugs!

That guys always speaking until program end. They are drinking their coffee one by one. By the way guy design doesn’t matter, it can cylinder head, box body … :smiley:

When one of them takes a sip from the mug and puts the mug back to the table, the other one will hold and raise the mug, take a sip and put it back. This will continue until the coffee inside the mugs is finished.

We can see coffee in mugs (decrease)…

VERY VERY THANKS

Okay. You start. What code do you have so far?

Do you know how to do 3D shapes? Lights? Translate?

Are you comfortable doing animations over time? Lerp positions?

If not, perhaps a 2D scene would be a better place to start.


In any case, BEHOLD: No one has written any code for you yet! This is because YOU have written no code yet. You MUST post some code if you want any real help.

Here is a 3D table

Regards

Chrisir

See Making a 3D table - #11 by Chrisir

You can also check out figures / bodies / robots on openprocessing etc., eg. 200606 - OpenProcessing

Thank you @Chrisir
My new code like that newbie :slight_smile:

import peasy.*;
PeasyCam camera;

ArrayList<Objects> objects = new ArrayList<Objects>();
Guy guy;
PShape head, body, arm, leg;

void setup() 
{
  guy=new Guy();
  size (700, 700, P3D);
  camera = new PeasyCam(this, 700);
  // frame.setLocation(0,0);
 
  // PShape head -- centered
  head = createShape(SPHERE, 20);
  head.setStroke(color(255));
  head.setStrokeWeight(4);
  head.setFill(color(126));
 
  // body -- above and below the center
  body = createShape(LINE, 0, -50, 0, 0, 50, 0);
  body.setStroke(color(255, 0, 0));
  body.setStrokeWeight(4);
  body.setFill(color(126));
 
  // arm -- extends down from the center
  arm = createShape(LINE, 0, 0, 0, 0, 50, 0);
  arm.setStroke(color(189, 0, 0));
  arm.setStrokeWeight(4);
  arm.setFill(color(126));
 
 
  // leg -- extends down from the center
  leg = createShape(LINE, 0, 0, 0, 0, 75, 0);
  leg.setStroke(color(189, 0, 0));
  leg.setStrokeWeight(4);
  leg.setFill(color(126));
  
  //FOR TABLE---------
  // 4 legs
  objects.add(new Objects(50-100, 102, -200, 10, 100, 10));
  objects.add(new Objects(50+100, 102, -200, 10, 100, 10));
  objects.add(new Objects(50-100, 102, -200+100, 10, 100, 10));
  objects.add(new Objects(50+100, 102, -200+100, 10, 100, 10));

  // and the table itself 
  objects.add(new Objects(50, 50, -200+50, 
    240, 10, 140 ));
}
 
void draw() {
  background(51);
 
  guy.show();
  guy.show();
  
  //Show table:
  for (Objects o : objects) 
    o.show();
}
//class

class Objects {
  PVector pos, bsize;
  Objects(int x, int y, int z, 
    int b, int h, int t) {
    pos = new PVector(x, y, z);
    bsize = new PVector(b, h, t);
  }
  void show() {
    pushMatrix();
    translate(pos.x, pos.y, pos.z);
    box(bsize.x, bsize.y, bsize.z);
    popMatrix();
  }  
}
class Guy{
 void show(){
      // body
    shape(body);
   
    // head
    pushMatrix();
    translate(0, -50, 0);
    shape(head);
    popMatrix();
   
    // arms
    pushMatrix();
    translate(0, -15, 0); // move arms from center up to shoulders
      pushMatrix();
        rotateZ(radians(55)); // swing left arm out
        shape(arm);
      popMatrix();
      pushMatrix();
        rotateZ(radians(-55)); // swing right arm out
        shape(arm);
      popMatrix();
    popMatrix();
   
    // legs
    pushMatrix();
      translate(0, 50, 0); // move legs down to bottom of body
      pushMatrix();
        rotateZ(radians(25)); // swing left leg out
        shape(leg);
      popMatrix();
      pushMatrix();
        rotateZ(radians(-25)); // swing right leg out
        shape(leg);
      popMatrix();
    popMatrix(); 
   }
}

Am I in right place? I will set location for stickman. I need mug on table :frowning:

Journey, cannot help you