Gamestudio Links
Zorro Links
Newest Posts
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
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,397 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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 | 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