0 registered members (),
1,251
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Senior Member
|
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.
|
|
|
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
OP
Senior Member
|
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.
|
|
|
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
Member
|
Member
Joined: Jun 2008
Posts: 151
Ukraine
|
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 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
Phonech
Newbie
|
Newbie
Joined: Feb 2009
Posts: 38
Germany
|
Hi! I've wrote a little script that maybe helps you to position your camera. #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.
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
Senior Expert
|
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: Phonech]
#268439
05/29/09 08:48
05/29/09 08:48
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
Yes this one I can use ![grin grin](/ubb7/images/graemlins/default_dark/grin.gif) , 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.
|
|
|
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
OP
Senior Member
|
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 grin](/ubb7/images/graemlins/default_dark/grin.gif) 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.
|
|
|
|