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.

Newcomers DBPro Corner / Sticky question

Author
Message
Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 3rd May 2004 06:33
How do I stick a 3d object that I have created to screen cooordinates?

like a gun in an fps? so I can be pointed in any direction and the gun is still there.

I'm using DBPro

Think Gad fro Spill Chock!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd May 2004 06:44
you want to offset it from your camera a little below and out front so you can see the barrel, then have it move as you camera moves


** DBP_NETLIB_v1 PLUGIN - FULL VERSION RELEASED! ** Mooooooo!
Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 3rd May 2004 17:25
right, how do i do that?

Think Gad fro Spill Chock!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 3rd May 2004 20:38
The help files are your friend. If you have not read them from cover to cover, you'll never learn the syntax of the language.

BTW, this is not the only method. You can also dynamically position the gun relative to the camera each sync. While this is more coding, you can achieve more control as well. (Weapon bobbing, recoil, switch animations, etc.)
--
TAZ

LOCK OBJECT ON
This command will lock the specified 3D object to the screen. Locking objects to the screen commands the object to completely ignore the camera's influence. A locked object will be positioned as though the camera had never been altered from its default orientation. To make locked objects visible, simply set the Z position to a significant positive value. The Object Number should be specified using an integer value.

SYNTAX
LOCK OBJECT ON Object Number

Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 5th May 2004 02:21
Right. The problem I'm having with LOCK OBJECT ON, is that it doesn't actually move the object. This means I can't do things like place a bullet at GunX#, GunY#, GunZ#, set the angle to GunAngleX#, GunAngleY#, GunAngleZ#, then move the puppy off.

The problem is one of math, how do I determine the same position relative to the camera despite where it is facing? I'm pretty sure that I'm going to use NewXValue, NewYValue, and NewZValue, but I don't know how to use them. The Help files say they replace Sine/Cosine, but my Math classes never taught me how to use Sine/Cosine either, so I'm somewhat at a loss.

Can somebody help?

Think Gad fro Spill Chock!
Trev
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Canada, Ontario
Posted: 5th May 2004 03:13
i am working on a fps and looking at my code i just used this peice of code to have the gun be in the same spot no matter how the camera moves unless i specificly say move the gun object to say getting it to bobble but if you just want the gun to be in the same spot no matter where the camera moves up/down left/right just load it like this


Trevor Somerville Making the best game Beast Hunter. So what if it dosn't have any sound or enemies yet....
Pixle Pusher
20
Years of Service
User Offline
Joined: 4th May 2004
Location: Monitor, Keyboard, Mouse. UK
Posted: 7th May 2004 15:23 Edited at: 7th May 2004 15:28
Found this on the forum.
Hope it helps.

Login to post a reply

Server time is: 2024-09-22 08:46:03
Your offset time is: 2024-09-22 08:46:03