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 / joystick crosshairs with 3D cube and collision command

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 04:17
I know how to do coillsion with 2 objects in 3D but how do i do it when it the center of a sprite linked to the joystick?

In Space No One can Hear You Scream! (When your comm Line is cut?)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Dec 2004 05:02
Firstly, you need to OFFSET SPRITE so that the collision is based on the centre of your sprite. Secondly, you actually need 2 sprites, the second one being 1 or 2 pixels wide and hidden. This is so that you can collide only with the centre point, and not the full crosshair. You perform collision on the hidden sprite.

In 2D, use SPRITE COLLISION.

In 3D, use PICK OBJECT, using the coordinates of the sprite (which is offset, as described above)

BatVink
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 05:09
that clears up one bit my prob is I have a sprite as my crosshairs and an object as my boxes, do you mean put an object where the sprite offset center would be.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd Dec 2004 05:47 Edited at: 22nd Dec 2004 05:48
Not trying to spoil the learning experience for you - so don't look at this code if you want to figure it out by yourself .... but if you get stuck on using the pick object commands to get distances of 3d objects from 2d coordinates, this will help you see how to do it:



control crosshairs with mouse, fire laser with left mouse button.


HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 05:59
Cheers, It does what i been looking now just got to work out how it's doing it so i can do other thing otherwise not bad 2 days and have it nearly doing everthing I started to make do.

In Space No One can Hear You Scream! (When your comm Line is cut?)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 06:01
should say

everthing I started out to do in the game plan.

In Space No One can Hear You Scream! (When your comm Line is cut?)

Login to post a reply

Server time is: 2024-09-23 07:35:59
Your offset time is: 2024-09-23 07:35:59