how do you create a third person view ?

Posted By: amirmehrvarz

how do you create a third person view ? - 01/01/13 20:09

hello i want to create a third person camera but i cant build it
please give me to source code so that i will be allowed to W.A.S.D and to be able to lock around with the mouse
(3dgs v8 & lite-c)
thank you
Posted By: amirmehrvarz

Re: how do you create a third person view ? - 01/02/13 08:04

please help me i need this source code or doc for this very soon
Posted By: Uhrwerk

Re: how do you create a third person view ? - 01/02/13 10:50

You're not only lazy, you're even impatient.

You can either do it yourself. In this case you will get any help you need from this community if you experience difficulties.

The other possibility is letting somebody do it for you and pay him or her.
Posted By: painkiller

Re: how do you create a third person view ? - 01/02/13 11:46

take a look at the manual: script libraries -> camera.c there you have different cameras ready to use
Posted By: Realspawn

Re: how do you create a third person view ? - 01/02/13 15:11

at my place in the basic workshops you find all camera codes.
Posted By: rayp

Re: how do you create a third person view ? - 01/02/13 15:43

Simple and fast way without math grin
Place a bone in your playermodel at the pos where the camera should be.
use this code
Code:
void cam2bone(STRING* bonename){
  while(my){
     vec_for_bone(camera.x,   me, bonename);
     ang_for_bone(camera.pan, me, bonename);
     wait(1);
   }
}
..
action myPlayer(){
 cam2bone("Name of the in med placed bone");
 ..
}


Same works with a vertex of course
Posted By: amirmehrvarz

Re: how do you create a third person view ? - 01/05/13 20:02

no no no i want to create a third person camera for example camera in evil 5 or
mafia 2 ,...
i can to build it but only (pan) . i can not build tilt
please help me
Posted By: Uhrwerk

Re: how do you create a third person view ? - 01/05/13 20:18

Please post your code and we will have a look at it.
Posted By: paracharlie

Re: how do you create a third person view ? - 01/06/13 06:33

Use this link for making complete game.
http://www.opserver.de/coni_users/web_users/pirvu/aum/aumonline_e/index.html
Posted By: paracharlie

Re: how do you create a third person view ? - 01/06/13 06:35

Never say you weren't helped by an American
Posted By: Realspawn

Re: how do you create a third person view ? - 01/06/13 10:58

@paracharlie

I don't see the problem here i pointed you to my place
were in the basic workshop are many camera views including the one you need. Others also pointed you in the right direction
so with a little effort you should have your solution laugh
Posted By: ratchet

Re: how do you create a third person view ? - 01/06/13 12:56

Well 3DGS is more for programmers, new people need to read AUM code.
For new comers, beginners, 3DG should re implement the default Third camera system (like in A6 days) !
I mean the default script selection when creating a new game.
Posted By: amirmehrvarz

Re: how do you create a third person view ? - 01/06/13 13:37

this is piece of my code (move and rotate )
but There are many problems for example
Player get into the walls and floor
Mouse go round 360 degrees
And when we shoot bullets fired from different places will

Code:
/////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////////////////
var c_move_w;
var c_move_s; 
///////////////////////////////main function ////////
function main ()
{
	level_load ("level1.wmb");
	video_mode = 7;
}
///////////////////////////////action myplayer ////////
action myplayer ()
{
	while(1)
	{
		/////////////////////////////////////move
		if (key_w == 1)
		{
			c_move(my,vector(40*time_step,0,0),NULL,GLIDE);
			ent_animate(my,"walk",c_move_w,ANM_CYCLE);
			c_move_w +=10*time_step;
		}
		if (key_s == 1)
		{
			c_move(my,vector(-40*time_step,0,0),NULL,GLIDE);
			ent_animate(my,"walk",c_move_s,ANM_CYCLE);
			c_move_s +=10*time_step;
		}
		//////////////////////////////////// pan
		my.pan -= mouse_force.x;
		my.tilt +=mouse_force.y;
		////////////////////////////////////camera following
		vec_set(camera.x,vector(-150,30,25)); //////////////third person camera
      vec_rotate(camera.x,my.pan);
      vec_add(camera.x,my.x);
      vec_set(camera.pan,vector(my.pan,-10,0)); 
      vec_set(camera.tilt,vector(my.tilt,0,0)); 
		/////////////////////////////////////////
		wait(1);
	}
}

Posted By: amirmehrvarz

Re: how do you create a third person view ? - 01/06/13 14:35

One thing I forgot to tell sorry paracharlie grin
Posted By: rayp

Re: how do you create a third person view ? - 01/06/13 17:15

first thing USE CODE TAGS.
Posted By: amirmehrvarz

Re: how do you create a third person view ? - 01/06/13 20:01

ok
help me
Posted By: ratchet

Re: how do you create a third person view ? - 01/06/13 20:07

You should check the last ones AUM magazine talking about the RPG template.
You have just to take the code of the third person character controller.
Posted By: Uhrwerk

Re: how do you create a third person view ? - 01/06/13 21:10

Your code overwrites random portions of memory.
Code:
vec_set(camera.tilt,vector(my.tilt,0,0));

Do the tutorial. I think you have no clue about the code above and that you have copied it from the AUM. Am I right about this?
Posted By: amirmehrvarz

Re: how do you create a third person view ? - 01/07/13 04:30

no no no only camera code is copy from the workshop 24
© 2024 lite-C Forums