Goood Morning and thank you for you Answer Malice,

if i user this code :
vec_set(temp, vector(-200, -100, 100) );
vec_rotate(temp,vector(camera.pan,0,0)); // or player pan
vec_add(temp,player.x);
vec_set(camera.x,temp);

// get the direction from the entity MY to the entity YOU
vec_set(temp,player.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan, vector(temp.x, temp.y, 0)); // now MY looks at YOU

also the snipet from superku and your code snipet after that
the screen roatets and rotates, the problem ist the second rotate "vec_to_angle(camera.pan, vector(temp.x, temp.y, 0)); "
if i delete
" vec_rotate(temp,vector(camera.pan,0,0)); // or player pan"
the problem ist fixed but the "offset" is properly not right, mmmh.

My problem is, if i use this code

// Store new camera position in tempVect
vec_diff(tempVect,camera.x, my.x); // The direction should be from player to camera
tempVect.z = 0; // remove height
vec_normalize(tempVect,CAMERA_OFFSET); // it should be CAMERA_OFFSET quants away
// adjust height
currCameraHeight += mouse_force.y * MOUSE_FACTOR * time_step;
tempVect.z = clamp(currCameraHeight, -CAMERA_OFFSET/3, CAMERA_OFFSET/3);
// Rotate with mouse movement
vec_rotateaxis(tempVect, vector(0,0,1), mouse_force.x * MOUSE_FACTOR * time_step) ;

vec_add(tempVect, my.x);
if(c_trace(my.x, tempVect, IGNORE_ME | IGNORE_PASSABLE)!=0){
vec_set(camera.x, target);
}
else{
vec_set(camera.x, tempVect);
}
// Look at player
vec_diff(tempVect,my.x, camera.x);
vec_to_angle(camera.pan,tempVect);

my player walk a circle

if i user this code :
camera.arc = 70;
camera.clip_near = 0;
my.pan -= 0.5 * mickey.x * time_step;
camera.pan += ang(my.pan - camera.pan) * time_step * 0.8;
camera.tilt -= 0.5 * mickey.y * time_step;
camera.tilt = clamp(camera.tilt,-30,30);
vec_set(cam_offset.x,vector(35,-25,40));
vec_rotate(cam_offset.x,camera.pan);
vec_add(cam_offset.x,my.x);
cam_pos.x = cam_offset.x + fcos((camera.pan),fcos(camera.tilt,-100));
cam_pos.y = cam_offset.y + fsin((camera.pan),fcos(camera.tilt,-100));
cam_pos.z = cam_offset.z + fsin(camera.tilt,-100);
result = c_trace(vector(my.x,my.y,my.z),cam_pos,IGNORE_MODELS|IGNORE_SPRITES);
if(result > 0)
{
vec_scale(normal,15);
vec_add(target,normal);
vec_set(camera.x,target);
}
else
{
vec_set(camera.x,cam_pos);
}

i have a good offset

i will merge the codes for walk with a circle and have a offset , like Batman arkhan city , assasins creed and so on.

for "walk in a circle with an offset"

i hope you understand my problem and some people can help me

thank you for your time

best regards


- 3d Gamestudio Commercial -
- ANET Pro -
<JAVA | PHP | HTML | Flash > DEVELOPER