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 / Is there a way to point a 3d object at a sprite?

Author
Message
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 17th Apr 2004 00:10
Im just wondering if there is a way to point a 3d object so it will go towards my crosshairs, which is a sprite image, its located at screen width()/2-25 : screen height()/2-25.

I have this machine gun that I need the object to start at the bottom right hand corner of the screen, and work its way to the center of the crosshair, like its being shot from a right handed gun.

What would be the easiest way to do this, here is my code in source.

Thanks,
Zero

Zero (Formerly Shadow Guyver)
NRTP Message Boardshttp://nrtp.proboards22.com/index.cgi
Terra Elysium (A Megaman Fanclub)http://terraelysium.proboards28.com/
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 17th Apr 2004 01:19 Edited at: 17th Apr 2004 01:20
Um, do you need the machine gun to move or the bullets? Normal 3D perspective will take of most of that.

Orient your bullets to match the rotation of the camera. Sync the bullet's position to match the tip of your gun. Then, simply use MOVE OBJECT to move the bullets down range.

The problem with a 2D cross hair is that it does not adjust for offsets and range. It's only truly on target if your shooting bullets from your eyes. It's up to you. You can either live with hip firing machine guns, tweak the trajectory of the bullets, or perhaps move the gun to the middle of the screen when you fire. Actually, the last idea could be pretty clever. Allow the character to choose hip firing for maximum visiblity or allow them to move the gun so the sights line up with the cross hairs and allow maximum accuracy with a good part of the screen taken up by arms and weapon.
--
TAZ

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Apr 2004 01:20
Surely shooting it straight out in front of you will do the trick, it's just a parallax effect?

I'm guessing your sprite is 50 pixels wide, and is actually centred on the screen.

BatVink
http://facepaint.me.uk/catalog/default.php
AMD 3000+ Barton, 512K Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 17th Apr 2004 01:25
Yes my sprite is 50x50, and it would be nice to either have bullets that are invisible and have a gun to the right side of the screen, or have some way to make the bullets goto the crosshairs and hit on mark.

Is there a way to do the invisible bullet option?

Thx,
Zero

Zero (Formerly Shadow Guyver)
NRTP Message Boardshttp://nrtp.proboards22.com/index.cgi
Terra Elysium (A Megaman Fanclub)http://terraelysium.proboards28.com/
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Apr 2004 01:26
hide object [bullet no.], I think that's what you want

CURRENT PROJECT: RETRO PAC-MAN
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Apr 2004 13:59
If you don't want to see the bullets, you don't have to have an object at all. Use INTERSECT OBJECT() to calculate whether a bullet, if it existed, would have hit anything.

BatVink
http://facepaint.me.uk/catalog/default.php
AMD 3000+ Barton, 512K Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 17th Apr 2004 17:59
So could I use intersect object() to make it so that when the object hits it will display a sprite of a dent or a crack?

Thx,
Zero

Zero (Formerly Shadow Guyver)
NRTP Message Boardshttp://nrtp.proboards22.com/index.cgi
Terra Elysium (A Megaman Fanclub)http://terraelysium.proboards28.com/

Login to post a reply

Server time is: 2024-09-22 05:35:45
Your offset time is: 2024-09-22 05:35:45