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 / need help at aiming system DBP

Author
Message
MattBatt
18
Years of Service
User Offline
Joined: 15th May 2006
Location:
Posted: 16th May 2006 00:30
First of all, this is one of my first projects.

I would like to convert my crosshair's position to 3d, so I would have Box, let's say object number 4, always at the middle of the screen ( where my crosshair is pointing. ). And if possible it should follow even if I turn my camera.

I have triend couple codes that I found from the forums but didn't manage to convert them to fit my needs. Im asking if someone could do it for me becouse I couldn't figure it out myself. thanks <3

http://forum.thegamecreators.com/?m=forum_view&t=50598&b=6 <- tried to convert this one

and oh yeah, sorry for my bad english, hope you undertood what I ment

as an attachment is my project so far if you want to check it out

It wasn't my fault ;_;

Attachments

Login to view attachments
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 16th May 2006 02:20 Edited at: 16th May 2006 02:20
If the cross hair is always in the center of the screen, and you're certain positioning a box at it is what you need, just position the box at the user/cams position, rotate the box to the user/cams rotation, and move the box forward the required distance.

Here's a function to hel you out;



Object1 is the object to be positioned at the reticule (the box), object 2 would most likely be your character, and Distance# is the distance you want Object1 to be infront of Object2.

If you dont have a player object but rather a camera, replace the OBJECT POSITION() and OBJECT ANGLE() commands with CAMERA POSITION() and CAMERA ANGLE() commands.

- RUC'

tiffer
18
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 20th May 2006 18:29
y dont you just lock it to camera?

Cwatson

Login to post a reply

Server time is: 2024-11-26 19:49:55
Your offset time is: 2024-11-26 19:49:55