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
Lite-C Workshop #18 #335877
07/31/10 10:09
07/31/10 10:09
Joined: Mar 2005
Posts: 134
J
jeffmorris Offline OP
Member
jeffmorris  Offline OP
Member
J

Joined: Mar 2005
Posts: 134
I modified the code for Lite-C Workshop #18 so that the car moves forwards and backwards, and turns while moving forwards and backwards. How do I put the camera view inside the car to simulate driver's view?

Re: Lite-C Workshop #18 [Re: jeffmorris] #336215
08/02/10 12:22
08/02/10 12:22
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline
User
hopfel  Offline
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
From the manual:

Click to reveal..

camera
A predefined screen-sized view that is visible by default, and normally used for the active view.

Type:
VIEW*

Remarks:
Dynamic lights are clipped against the light_view, which is set to camera by default. If the active view is different to the camera view, the light_view pointer must be set to the active view, or to NULL when there are several active views and the lights must not be clipped against one of them.

Example:
while(1) {
vec_set(camera.x,player.x); // move the camera together with the player entity
vec_set(camera.pan,player.pan);
wait(1);
}


Was it that hard to look for it in the SED-help? o.0


Hilf mir, dir zu helfen!
Re: Lite-C Workshop #18 [Re: hopfel] #336317
08/03/10 00:45
08/03/10 00:45
Joined: Mar 2005
Posts: 134
J
jeffmorris Offline OP
Member
jeffmorris  Offline OP
Member
J

Joined: Mar 2005
Posts: 134
I used this code and it worked.

vec_set(camera.x,my.x);
vec_set(camera.y,my.y);
vec_set(camera.z,my.z+15);
vec_set(camera.pan,my.pan);

I had to raise the Z axis 15 units so that the camera is over the hood of the car.

Re: Lite-C Workshop #18 [Re: jeffmorris] #336322
08/03/10 04:22
08/03/10 04:22
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
If you'd take a look at the manual, you'd notice that vec_set actually copies three values. So you can minimize your code a little bit:
Code:
vec_set(camera.x,my.x);
camera.z+=15;
vec_set(camera.pan,my.pan);




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