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 Professional Discussion / sparkys and planes

Author
Message
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 10th Jul 2011 00:38
can a raycast like those sparkys dll use register a collision with a plane if the ray is paralel with the plane? In other words hitting it precisely on its edge ?
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 10th Jul 2011 19:51
I doubt you'll ever be in a situation where that'd happen, because of floating point inaccuracy and the likes. Is there is a reason you need that?

noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 10th Jul 2011 22:41
yes i would have all my planes on the same level ( plane ) that means that they would actually act as sprites kind of. So yes a raycast from one to the other would always hit it on the side.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 11th Jul 2011 13:46
Ah I see. Hm, perhaps you're better of with very thin boxes rather than planes, I'm not sure how that'll work out.

29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 11th Jul 2011 21:43
The way I'd do this is to make invisble boxes that are the same size and shape as the plane and then place the boxes in the same position and orientation as the plane, making sure that the box extends either side of the plane, i.e if the planes are on the XY plane, then the boxes should extend in the positive and negative Z directions.

Then do all the ray casting against the boxes rather then the planes but it'll all still look the way you want.

You could even attached the boxes as limbs then use the HIDE LIMB commmand.
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Jul 2011 04:26
No, if it was greater or equal to 0.00000001 of the the maffs involved. Consider raycasting to a sphere and the ray just misses a flat plane you're casting to.

It's really only a problem if you need it to be that precise. In that case your geometry would have to be more precise too.

Warning! May contain Nuts!
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 12th Jul 2011 19:49
ok thanks people that was exactly what i needed to know. Question nr 2 is it possible to have animated planes from spritesheets?
29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 13th Jul 2011 01:32
I've never doene this before but I would try either:

1) Have a number of planes, texture each with a frame of the animation and then show and hide the planes in sequence

or

2) Have a single plane and retexture it with the frames of the animation.

I'd probably go for the first one.
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Jul 2011 01:36
You can re-texture the object any time. But unless you separate your sprite sheet into separate images then you would have to faff about with the UV data. It would be easier to have a function to load your sprite sheet and create images of each sprite from it. You can store the image info in an array.

Warning! May contain Nuts!
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 13th Jul 2011 12:11
store image info into an array?? How and what does that do?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Jul 2011 15:06
Hopefully this might help with your own tweaking.



Warning! May contain Nuts!
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 14th Jul 2011 00:16
ok got it thanks. Its just that im thinking about using particles for my effects instead of using sprite sheets so it might not be necesary but thanks

Login to post a reply

Server time is: 2026-07-10 21:41:55
Your offset time is: 2026-07-10 21:41:55