2 people chat

Started by
10 comments, last by FGFS 9 years, 10 months ago

HI

I want two people DR1 and DR2 chat. So moving heads towards each other and back to forward. Sometimes randomly they should also look down or up.

So this is where I'm stuck. Other eyes might find a solution for me? There might even be a simpler, completely different approach, well below

I got lost.

Many thanks in advance

if( SDL_GetTicks() - ct > 200 )
{
ct = SDL_GetTicks();

if (rand()%50 == 2 || nun == 1){
nun = 1;
if (ctside <= 0 && still == 0){
DR1value += 0.1;
}else{
if (ctside >= 1 && still == 0){
DR1value -= 0.1;
}
}

if (ctdown == 0 && nun1 == 1){
DR2value += 0.1;
still = 1;
}else{
if (ctdown >= 1){
DR2value -= 0.1;
still = 0;
}
}
}
}
if(DR1value >= 1){
ctside = 1;
nun = 0;
}
if(DR1value <= 0.1){
ctside = 0;
nun1 = rand()%5;
}
if(DR2value >= 1){
ctdown = 1;
nun1 = 0;
}
if(DR2value <= 0.1){
ctdown = 0;
//nun1 = 0;
}

Advertisement

Take an array of images and let a random number decide which to display.

Hmm what do you mean? I've dr1value and dr2value from 0 to 1 so 0.1, 0.2 etc. Probably I need dr3 for looking up and dr4 values for looking down.

Maybe I do misunderstand what you want.

I thought of two images representing two people that move in such a way that it looks like they are talking with each other.

I've two blender meshes/faces looking forward like in a train, car etc. So for talk they should look a little at each other, then back forward and once in a while up or down. They are attached to datarefs for movement. DR1, dr2 etc. from 0 to 1. I only need the logic for movement. Thanks for ideas.

Take me off the list with man with ideas :)

What have you tried? What exactly are you having difficulty with? (We know what you want to accomplish, now please explain why you're stuck.)

Most importantly: what isn't happening that you want to happen, given the code you posted?

You have not provided enough information for anyone to be helpful.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Imagine a car. The driver and the person aside has a roadmap on the legs. Now they chat a little while driving and the person checks once in a while the map.

We call them DR1 and DR2 which go each from 0-1 for looking sideways. And let's say DR1up/down, DR2up/down for up/down looking.

My above code looks way unnatural and incomplete. Thanks

Define a center point for each element of the body/face that can move, e.g. eyes, head, neck, arms, and so on. Then define a range of motion for each one. Once you have those numbers, just pick a random position within that range from the "center" for each element. Interpolate from one position to the next over time. When you reach a target position, pause for a random time period, and then pick a new target.

This is just a start, of course; realistically you'll want to couple certain types of movements (head and eyes look down at map while hands raise map slightly, and so on).

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

DR1/2 always start with 0 and can go up to 1 as I've explained above. Thanks for code examples.

This topic is closed to new replies.

Advertisement