Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
3rd person camera problems #355282
01/26/11 00:54
01/26/11 00:54
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
i was reading the topic "camera pan and entity pan" and i wouldve just replied to his with my question but i didnt think it would be right. so please forgive me for making a 2nd topic on one subject smirk

anyways, im trying to make a 3rd person cam as well, but every time i mention the temp vector, it says x is an undeclared identifier, i dont get it. why is it doing this? it happens in lines like this:

Code:
vec_diff(temp.x,camera.x,my.x);



i of course have a variable to define "temp". i dont understand what im doing wrong.


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: 3rd person camera problems [Re: Doc_Savage] #355283
01/26/11 01:21
01/26/11 01:21
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
type of temp is VECTOR or var[3]?

Last edited by Quadraxas; 01/26/11 01:21.

3333333333
Re: 3rd person camera problems [Re: Quad] #355285
01/26/11 03:49
01/26/11 03:49
Joined: Jan 2011
Posts: 120
United States
Logan Offline
Member
Logan  Offline
Member

Joined: Jan 2011
Posts: 120
United States
Yeah. To access x, y, or z, temp would have to be defined as "VECTOR temp" or "VECTOR* temp". If it's var temp[3], you would have refer to them as temp[0], temp[1], and temp[2]... although in your line of code you posted, both of those would be redundant, since you're referring to temp as a whole, not just the x component.

Code:
vec_diff(temp,camera.x,my.x);



See how that works.

Re: 3rd person camera problems [Re: Logan] #355288
01/26/11 07:00
01/26/11 07:00
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
haaaa... oh man.. it was a variable not a vector.. im so dumb.. hahah
ok one more question (i think)

whats wrong with this line?

Code:
result = c_trace(my.x,temp.x(my.x,my.y,my.z-100),IGNORE_PASSABLE|IGNORE_MODELS);



it says: "call function @temp_01264 error"


i wish i knew what that meant. see this code was for a morrowind type camera script, where i could press a button and switch between the 2, i started in c_script and have now converted it. exept for this part. here was the origional:

Code:
trace_mode = ignore_me+ignore_passable+ignore_models;
result = trace(my.x,temp.x);



im guessing i got some part wrong in the conversion. hehe.. thanks in advance for putting up with my dumb questions fellas lol.

Last edited by Doc_Savage; 01/26/11 07:43.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: 3rd person camera problems [Re: Doc_Savage] #355292
01/26/11 08:31
01/26/11 08:31
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
I think "Migration into Lite-C" from manual will help you.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 3rd person camera problems [Re: 3run] #355294
01/26/11 08:43
01/26/11 08:43
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
ive read it. in the gamestudio help right? yea ive read it. rather incomplete imo. cant find anything on this problem. any idea what i did wrong?

Last edited by Doc_Savage; 01/26/11 08:46.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: 3rd person camera problems [Re: Doc_Savage] #355296
01/26/11 09:01
01/26/11 09:01
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline
Senior Member
Roel  Offline
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Quote:
result = c_trace(my.x,temp.x(my.x,my.y,my.z-100),IGNORE_PASSABLE|IGNORE_MODELS);


it's the temp.x(my.x,my.y,my.z-100)

I don't exactly know what you mean with the code,
but you can use both:

.....vector(my.x,my.y,my.z-100).....
or ....temp....

you have to set temp[0] <== x, temp[1] <== y and temp[2] <==z to the values you want


when you type temp.x(my.x,my.y,my.z-100)
the compiler will start searching for a function x of the object temp, and give it the arguments my.x,my.y and my.z-100.... which doesn't exist.

I hope this helps


Check out the throwing game here: The throwing game
Re: 3rd person camera problems [Re: Roel] #355298
01/26/11 09:24
01/26/11 09:24
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
ok ive gotten this solved, but for some reason when i move foreward or backward the camera dosent move with the player...

gaah its all messed up. maye i should stick with 1st person...

Last edited by Doc_Savage; 01/26/11 09:29.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: 3rd person camera problems [Re: Doc_Savage] #355299
01/26/11 09:30
01/26/11 09:30
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Can you show us all of your camera script? And tell us where do you call it in player while loop?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 3rd person camera problems [Re: 3run] #355301
01/26/11 09:48
01/26/11 09:48
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
this is all i can really show atm.

Code:
function Switch_Views()
{
  if(camera_ViewMode == 1) // 1st Person
  {
	vec_for_vertex(eyespot,my,69);
	camera.genius = my;
	camera.arc = 80;
	vec_set(camera.x,vector(my.x,my.y,my.z+30));
	my.pan = camera.pan;
	camera.roll = my.roll;
	if(key_o){
camera.tilt += 50 * mouse_force.y * time_step;
camera.pan -= 50 * mouse_force.x * time_step;
}
else
	camera.pan -= 10 * mouse_force.x * time_step;
	camera.tilt += 10 * mouse_force.y * time_step;
	camera.tilt = clamp(camera.tilt,-90,90);
    if(key_e)
   {camera.roll = 30;
   camera.y = 20;
   } 
   if(key_q)
   {camera.roll = -30;
   camera.y = -20;
  }
  }
  else // 3rd Person
 {
 my.pan = camera.pan;
camera.pan -= mouse_force.x * 12 * time_step;
camera.tilt += mouse_force.y * 8 * time_step;
camera.tilt = clamp(camera.tilt,-30,10);
temp = fcos(camera.tilt,-camera_distance);
vec_set(camera.x,vector(my.x + fcos(camera.pan,temp),my.y +
fsin(camera.pan,temp),my.z + 20 + fsin(camera.tilt,-camera_distance)));
vec_diff(temp.x,camera.x,my.x);
vec_normalize(temp.x,16);
vec_normalize(temp.z,50);
vec_set(camera.x,target.x);
vec_add(camera.x,temp.x);
result = c_trace(my.x,temp.x,vector(temp.x,temp.y,temp.z-10),IGNORE_PASSABLE|IGNORE_MODELS);
if (result > 0) {
vec_diff(temp.x,my.x,target.x);
vec_normalize(temp.x,16);
vec_set(camera.x,target.x);
vec_add(camera.x,temp.x);
}
}
}



first person is fine, 3rd person is messed up. seems i over complicated it tongue

Last edited by Doc_Savage; 01/26/11 09:51.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Page 1 of 2 1 2

Gamestudio download | 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