Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by NeoDumont. 02/17/26 15:40
Hedge on FXCM, 4 or 5?
by Martin_HH. 02/16/26 16:09
Zorro version 3.0 prerelease!
by jcl. 02/12/26 14:05
MarginCost discrepancy?
by jcl. 02/12/26 14:02
CMC MT4 CFD vs FX Active - what's better?
by mayarik. 02/11/26 11:00
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (Quad, TipmyPip, alx, qin), 7,494 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: camera in panel frame [Re: Xarthor] #288621
09/07/09 17:14
09/07/09 17:14
Joined: Aug 2007
Posts: 157
England
DeD Offline OP
Member
DeD  Offline OP
Member

Joined: Aug 2007
Posts: 157
England
how do you mean i dont get it

ive this peice of code but it doing nothing.

function camera_rearview()
{
while(player)
{
vec_set(camera.x, player.x); // copy player position to camera position
vec_set(camera.pan, player.pan); // copy player direction to camera direction
wait(1);
}
}

function camera_start()
{
view_mirror.x = 10; // X-Position in View = 10
view_mirror.y = 100; // Y-Position in View = 100
view_mirror.z = 0; // Z-Position in View = 0
}


D.E.D

I use lite c
Re: camera in panel frame [Re: DeD] #288623
09/07/09 17:25
09/07/09 17:25
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Well for a rear-mirror you need two views.
One is the standard view (name: camera) and one is the newly created view_mirror.
Now for looking back you can use the view_mirror, while camera looks somewhere else (maybe the direction the player is driving? could be helpful)

So you'll only need this function:
Code:
function camera_run()
{
  while(!player) { wait(1); } // wait until pointer is valid

  while(player) // while player exists
  {
    vec_set(camera.x, player.x); // copy player position to camera position
    vec_set(camera.pan, player.pan); // copy player direction to camera direction

    vec_set(view_mirror.x, player.x);
    vec_set(view_mirror.pan, player.pan);
    view_mirror.pan += 180; // you want to look behind the player
  
    wait(1);
  }
}



Re: camera in panel frame [Re: Xarthor] #288637
09/07/09 18:55
09/07/09 18:55
Joined: Aug 2007
Posts: 157
England
DeD Offline OP
Member
DeD  Offline OP
Member

Joined: Aug 2007
Posts: 157
England
thxs for the help guys works gd now


D.E.D

I use lite c
Page 2 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