Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (monarch), 1,259 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How do I make my camera do this? #268334
05/28/09 17:27
05/28/09 17:27
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
I have a lagre room, and I whant to have a camera code that does this:

Look into the hole room from one of the walls.


How would I do that? In writing code in Lite-c.
Is that possible or should I set a camera in the "wall" look into the room?




Last edited by Eagelina; 05/28/09 17:33.

A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I make my camera do this? [Re: Eagelina] #268339
05/28/09 17:48
05/28/09 17:48
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
you can increase the camera.arc.
For testing try this:

camera.arc += key_1 - key_2;

Re: How do I make my camera do this? [Re: Pappenheimer] #268346
05/28/09 19:11
05/28/09 19:11
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
I dont whant to be able to move the camera , it must stand still and show the hole room.


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I make my camera do this? [Re: Eagelina] #268349
05/28/09 19:42
05/28/09 19:42
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
Quote:
camera.arc += key_1 - key_2;

that code dont move camera, this only change field of view.
if you want place camera to some position
vec_set(camera.x,vector(x,y,z));
and rotate to angle that you need
vec_set(camera.pan,vector(pan,tilt,roll));


A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: How do I make my camera do this? [Re: Eagelina] #268354
05/28/09 20:04
05/28/09 20:04
Joined: Feb 2009
Posts: 38
Germany
P
Phonech Offline
Newbie
Phonech  Offline
Newbie
P

Joined: Feb 2009
Posts: 38
Germany
Hi! I've wrote a little script that maybe helps you to position your camera.

Code:
#include <acknex.h>
#include <default.c>

void main()
{
	level_load("test.wmb");
	while(1)
	{
		camera.x += (key_w-key_s)*5*time_step;
		camera.y += (key_a-key_d)*5*time_step;
		camera.z += (key_cuu-key_cud)*5*time_step;
		camera.arc += (key_q - key_e)*5*time_step;
		wait(1);
	}
}

PANEL* cam_poition =
{
	digits(5,5,"CAMERA_X: %.1f",("Arial#20"),1,camera.x);	
	digits(5,25,"CAMERA_Y: %.1f",("Arial#20"),1,camera.y);
	digits(5,45,"CAMERA_Z: %.1f",("Arial#20"),1,camera.z);
	digits(5,65,"CAMERA_ARC: %.1f",("Arial#20"),1,camera.arc);
	flags = VISIBLE;
}


EDIT: Just edited the code, thanks Quadraxas didn't know that so far. grin


Last edited by Phonech; 05/28/09 20:21.
Re: How do I make my camera do this? [Re: Phonech] #268355
05/28/09 20:06
05/28/09 20:06
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
@phonech you know you dont need to define text for that, you can have text in digits. check the manual.

sorry for offtopic.


3333333333
Re: How do I make my camera do this? [Re: Quad] #268356
05/28/09 20:10
05/28/09 20:10
Joined: Feb 2009
Posts: 38
Germany
P
Phonech Offline
Newbie
Phonech  Offline
Newbie
P

Joined: Feb 2009
Posts: 38
Germany
Oh, thanks! I'm still learning. grin

Re: How do I make my camera do this? [Re: Phonech] #268439
05/29/09 08:48
05/29/09 08:48
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Yes this one I can use grin, love the way I can see what digits I need to set the camera exsactly where I whant it.

Thanks!


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I make my camera do this? [Re: Phonech] #268444
05/29/09 09:03
05/29/09 09:03
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Hi I added TILT to the code so we can find the exsact tilt we whant to grin

Code:
while(1)
	{
		camera.x += (key_w-key_s)*5*time_step;
		camera.y += (key_a-key_d)*5*time_step;
		camera.z += (key_cuu-key_cud)*5*time_step;
		camera.arc += (key_q - key_e)*5*time_step;
		camera.tilt += (key_t-key_y)*5*time_step;//added tilt
				
		wait(1);
	}


PANEL* cam_poition =
{
	digits(5,5,"CAMERA_X: %.1f",("Arial#20"),1,camera.x);	
	digits(5,25,"CAMERA_Y: %.1f",("Arial#20"),1,camera.y);
	digits(5,45,"CAMERA_Z: %.1f",("Arial#20"),1,camera.z);
	digits(5,65,"CAMERA_ARC: %.1f",("Arial#20"),1,camera.arc);
	digits(5,85,"CAMERA_TILT: %.1f",("Arial#20"),1,camera.tilt);//Tilt
	flags = VISIBLE;
}



A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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