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 Discussion / 1st person camera following gun?

Author
Message
doom on cats
21
Years of Service
User Offline
Joined: 31st Mar 2004
Location: stuck in a minnesota blizzard
Posted: 15th Mar 2005 09:01
i tried a whole crap load of ways to make a first person view of a gun just like in medal of honor and call of duty, but i can't get the camera to follow the gun around, a little help?
dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 15th Mar 2005 16:57
What you should try is positioning the object to a specific whereabouts on your screen before the game loop and use the "Lock object On Object Number" command as this will mean the object stays glued to the screen position

the answer to all lives questions is...
... meh!
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 19th Mar 2005 07:00
Lock Object On will work most of the time, but sometimes you may encounter a bug where it shows the locked object as if culling were turned off, even though culling is most definitely on. If you encounter this you will have to write your own object locking routine.

Crazy Donut Productions
Current Project: A Redneck game
thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 25th Mar 2005 10:25
Yeah, lock object on doesn't really work right sometimes. Basically, there are 2 ways to do it with using lock object on.

On way is to design your object so that it's offset from the XYZ 0,0,0 in the modeller, and then just go like this to position it:



Or, you can use COS() and SIN() maths (or, apparently, the NewXValue, NewYValue, NewZValue functions) to position a regular model in the correct position.

-thinkdigital
eGeneric Works : DB Site
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 27th Mar 2005 02:28
idiot,

Check my post out under the subject 'Lock object on thing", posted by steve c. I have included some source for a 2D program which explains how to create your own 'Lock Object On' command, using sin and cos maths. Takes some practice to understand the concept, but in the end is very self-explainatory.

+NanoBrain+

Login to post a reply

Server time is: 2025-05-31 05:32:55
Your offset time is: 2025-05-31 05:32:55