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
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 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 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