Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / FPS Camera Problems!

Author
Message
Mike P
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: England
Posted: 30th Mar 2005 22:03 Edited at: 30th Mar 2005 22:08
Ok there is some code below that kind of works but seems to be a little messed up. Please tell me whats wrong!!

It is supposed to have the camera following a first person gun. It works fine when you are not moving or are just turning left and right (not pressing up or down arrow keys). However when you press the up arrow key the gun zooms out infront, then slows to its normal pace. When you release the up key the gun falls back to its original position.

When you press the down arrow key the camera turns to face the end of the gun...

Here is the code:


Here are some screenshots:

1. Normal, using left and right arrow keys, works fine:


2. While pressing up arrow key


3. While pressing down arrow key


[center]
Worship Me OR DIE - http://www.ibse.r8.org
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 30th Mar 2005 22:33
thats because your camera is trying to follow the gun.. I think you want to lock it to the screen..

I forget the command - but there is a command that locks it to the screen.

The effect you're seeing is a kind of 3rd person view.

My Website:
BF game programmer
20
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: hoover alabama
Posted: 30th Mar 2005 22:37
try


james bond rules
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 30th Mar 2005 22:39
thats the jobby

I knew it was Lock related

My Website:
Pyro990
20
Years of Service
User Offline
Joined: 25th Oct 2004
Location: UK
Posted: 30th Mar 2005 22:42
You'll have to position the gun first though, before you lock it. Leave it at X=0,Z=0 then change Y till it's on screen, then change X till it's in the right place.

My Site
Laptop: P4 3.4GHz w/HT-120GB HDD-1GB DDR SDRAM-nVIDIA GeForce FX Go5700 128MB
PC: P4 2.8GHz-30GB HDD-1GB RAM-nVIDIA GeForce FX5200 256MB
Mike P
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: England
Posted: 30th Mar 2005 22:57
Hmmmmmm. I did this:



Wow... I think I did something wrong

[center]
Worship Me OR DIE - http://www.ibse.r8.org
Beavis
22
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 30th Mar 2005 22:58
solution...
remove code "set camera to follow"
and replace it with


--------
Beavis
http://www.progress-studio.com
Mike P
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: England
Posted: 30th Mar 2005 23:16
Hmm I did this:


Now its still messed up, see video:

http://217.42.61.182/hmm.avi

[center]
Worship Me OR DIE - http://www.ibse.r8.org
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 30th Mar 2005 23:56
once you've locked an object, you dont move the object. Move the camera and the object will stay on the screen.

If you want the camera to bob when you move it, you could maybe play abuot with changing its height based on a sin function (like height = sin(timer())

just an idea - but you need to restructure your code.

1) load the obejct
2) lock to screen
3) position it so its nice on the screen
4) use the arrows to move the camera

should all be fine like that.

My Website:
Pyro990
20
Years of Service
User Offline
Joined: 25th Oct 2004
Location: UK
Posted: 31st Mar 2005 01:45
Don't you need to switch 2 and 3?

My Site
Laptop: P4 3.4GHz w/HT-120GB HDD-1GB DDR SDRAM-nVIDIA GeForce FX Go5700 128MB
PC: P4 2.8GHz-30GB HDD-1GB RAM-nVIDIA GeForce FX5200 256MB
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 31st Mar 2005 02:12
That was off the top of my head while in PHP/HTML/CSS mode.. Its quite likely Hehe..

I thought you locked the positioned.. But I could be wrong. Wouldn't hurt to try both!

My Website:
M Gaming
21
Years of Service
User Offline
Joined: 23rd Mar 2004
Location: Everywhere
Posted: 31st Mar 2005 07:24
Here is what you need to do:
1) Scale the object to a reasonable size (since DarkMatter models are small in nature, scale it to 3000,3000,3000)
2) Either move it to a reasonable position, then lock the object, or
3) Use newxvalue and newzvalue (and altered y value) to position it correctly near the camera, so that you can achieve lighting effects, etc.

M Gaming
Game: Parallel Dimension
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 31st Mar 2005 09:01
whats wrong with the way I said it: make/load, lock, position, play..



Hope this helps..

My Website:

Login to post a reply

Server time is: 2025-05-28 04:49:29
Your offset time is: 2025-05-28 04:49:29