Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, bigsmack, 7th_zorro, dr_panther), 1,364 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
need code for camera #292746
10/06/09 15:15
10/06/09 15:15
Joined: Feb 2009
Posts: 13
washington
foxter888 Offline OP
Newbie
foxter888  Offline OP
Newbie

Joined: Feb 2009
Posts: 13
washington
i'm new at lite-c I saw everything about the documentation but it doen'ts explains much about making a camera
can anybody help me in how to make a 3rd person cam?? it doen't really need to rotate just to follow the character
and to please explain me how it works so I can reference from it.

Re: need code for camera [Re: foxter888] #292753
10/06/09 16:58
10/06/09 16:58
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Hi,
Go here and type in the search box 3rd person camera.
I remenber there was some code in the mag. for 3rd per.cam.
I think, I maybe wrong, but from mag. 65 on can be used in lite-c. You should download all the mag. Alot of good stuff in them.
renny grin


http://www.gstools.de/index.php?option=com_content&task=view&id=10&Itemid=54

Last edited by sadsack; 10/06/09 16:59.

I have A7 Commercial .............. Now I just need to learn how to use it

Re: need code for camera [Re: foxter888] #292754
10/06/09 17:00
10/06/09 17:00
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline
Senior Member
Razoron  Offline
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
a code snippet from my script:
Code:
if (key_a-key_d==0)
{
 leftright=0;
}
move = 7*(key_w-key_s)*time_step; //moves the player with [w] [a] [s] [d]
leftright+=key_a*(0.1*time_step);
leftright-=key_d*(0.1*time_step);
if (leftright>1.4)
{
 leftright=1.4;
}
if (leftright<-1.4)
{
 leftright=-1.4;
}
camera.pan += (3*time_step)*leftright;
my.pan=camera.pan;
camera.x = my.x-200*cos(my.pan);
camera.y = my.y-200*sin(my.pan);
camera.z = my.z+100;
camera.tilt += mouse_force.y;
if(camera.tilt < -50) {camera.tilt = -50;}
if(camera.tilt > 20) {camera.tilt = 20;}



my = player

Re: need code for camera [Re: Razoron] #292807
10/07/09 07:51
10/07/09 07:51
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Here's a quick one:
Code:
// Put it in the player's action:
while(1)
{
	player.x = camera.x - 50; // Edit this to fit your code
	player.y = camera.y
	player.z = camera.z -  25 // Edit this to fit your code
	player.pan = camera.pan;
	wait(1);
}



Re: need code for camera [Re: Cowabanga] #292934
10/07/09 21:49
10/07/09 21:49
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
try this on for size, it may fit
Code:
#include <acknex.h>
#include <default.c>

ENTITY* player1;




}

function act_player1()
{ 
  
	while(!me){wait(1);}
                player1 = me;
	me.ambient = 10;
	while(me)
	{
		if (key_a || key_cul) {me.pan += 3*time_step;}
			if (key_d || key_cur) {me.pan -= 3*time_step;}
			if (key_w || key_cuu){c_move (me,vector( 5,0,0),nullvector,GLIDE);}
			if (key_q || key_cuu){c_move (me,vector( 60,0,0),nullvector,GLIDE);}
			if (key_s || key_cud){c_move (me,vector( -5,0,0),nullvector,GLIDE);}
			
		wait(1);
	}
}



function main()
{
	level_load ("");
	wait(2);	// wait until the level is loaded
	ent_create("cube.mdl",vector(500,0,0),act_player1);
	
	while(1) {
  vec_set(camera.x,player1.x); 
  vec_set(camera.pan,player1.pan); 
  
  wait(1);
}
}



this is frist person, but just off set the camera from the object for 3rd person.
renny


I have A7 Commercial .............. Now I just need to learn how to use it


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1