Gamestudio Links
Zorro Links
Newest Posts
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
ZorroGPT
by TipmyPip. 10/24/26 01:54
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
No connection to MT4
by JeyKey II. 10/22/26 15:33
Zorro tutorial ideas?
by mistery. 10/21/26 05:28
Avoid "log\ - delete old files" message
by Martin_HH. 10/20/26 07:23
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 5,885 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
First Person Camera #372986
06/06/11 14:29
06/06/11 14:29
Joined: Jun 2011
Posts: 22
Germany
B
Bennett Offline OP
Newbie
Bennett  Offline OP
Newbie
B

Joined: Jun 2011
Posts: 22
Germany
Hey Guys, I need help with making a fp camera.
Basically, I have 2 problems:

1: I don't know how to keep the mousepointer in the middle of the screen. With the code from the workshops, it moves faster than the camera.

2: How do you move the camera with a PhysX Collision box?

I am grateful for any help.

Re: First Person Camera [Re: Bennett] #373002
06/06/11 16:22
06/06/11 16:22
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline
Junior Member
Ercoles  Offline
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
For your first question I also needed to do this in one of my projects and I solved it like this:

mouse_mode=1;
mouse_map = crosshair_pcx;// crosshair image declared before
mouse_pos.x = 649;// place crosshair in centre
mouse_pos.y = 300;// place crosshair in centre
mouse_spot.x = bmap_width(crosshair_pcx)/2;//set mouse pointer hotspot in middle
mouse_spot.y = bmap_height(crosshair_pcx)/2;//set mouse pointer hotspot in middle
while (1)
{
camera.pan -= mouse_force.x*2;
camera.tilt += mouse_force.y*2;
wait(1);
}

I had a 1440*900 resolution screen, so for your case you will need to use other values for mouse_pos.x & mouse_pos.y

Last edited by Ercoles; 06/06/11 16:25.
Re: First Person Camera [Re: Ercoles] #373008
06/06/11 18:01
06/06/11 18:01
Joined: Jun 2011
Posts: 22
Germany
B
Bennett Offline OP
Newbie
Bennett  Offline OP
Newbie
B

Joined: Jun 2011
Posts: 22
Germany
Thank you very much!

Re: First Person Camera [Re: Bennett] #373010
06/06/11 18:08
06/06/11 18:08
Joined: Jun 2011
Posts: 22
Germany
B
Bennett Offline OP
Newbie
Bennett  Offline OP
Newbie
B

Joined: Jun 2011
Posts: 22
Germany
okay, so incase anyone is interested: the values for a 1024*764 screen are:
x=490
y=350

Re: First Person Camera [Re: Bennett] #373012
06/06/11 18:16
06/06/11 18:16
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
You can also use

x = screen_size.x/2-bmap_width(crosshair_pcx)/2
y = screen_size.y/2-bmap_height(crosshair_pcx)/2


in order to make it resolution independent.

Re: First Person Camera [Re: the_clown] #373059
06/07/11 09:46
06/07/11 09:46
Joined: Jun 2011
Posts: 22
Germany
B
Bennett Offline OP
Newbie
Bennett  Offline OP
Newbie
B

Joined: Jun 2011
Posts: 22
Germany
Thank you!


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