Author Topic: X_COLLISIONRAY small target area  (Read 2752 times)

Offline UBERmonkeybot

  • Mr. Polyvector
  • ***
  • Posts: 243
    • View Profile
X_COLLISIONRAY small target area
« on: 2016-Jan-21 »
I am messing around with the 3d side of things and am trying to get X_COLLISIONRAY to work,it seems i can only detect a hit when i am hitting the exact center of the object with the ray,Is this correct or am i doing something dumb?
If this is the case i will have to come up with another method.

I also am not getting any debug lines as stated in the manual.



Thanks.....
« Last Edit: 2016-Jan-21 by monkeybot1968 »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10851
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: X_COLLISIONRAY small target area
« Reply #1 on: 2016-Jan-22 »
There's a demo in the samples, no?
It should work on per triangle collision

Offline UBERmonkeybot

  • Mr. Polyvector
  • ***
  • Posts: 243
    • View Profile
Re: X_COLLISIONRAY small target area
« Reply #2 on: 2016-Jan-22 »
I cant find anythng in the samples,I have made my own sample but as i said the collision is very specific in the Y axis,i find it has to be exactly in line to return distance.if i change teh y at all i get no collision

Code is attached if you fancy a look.

Thanks

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1545
    • View Profile
Re: X_COLLISIONRAY small target area
« Reply #3 on: 2016-Jan-22 »
Help file on X_SCALEMODEL says "The advantage is that X_SCALING 1,1,1 allows the X_COLLISION, shadow and bump mapping effects to work properly." and, although not used here, in X_SCALING says "Scaled objects - especially objects that aren't scaled equally in all directions - will not work with the command X_COLLISION."  :rtfm:
 ::)
So I suggest removing that and generate the sphere and box within code sample from X_COLLISIONSPHEREBOX in the help file! Also be aware of culling!!!  :P

Offline UBERmonkeybot

  • Mr. Polyvector
  • ***
  • Posts: 243
    • View Profile
Re: X_COLLISIONRAY small target area
« Reply #4 on: 2016-Jan-22 »
Ahha!!!!  well done Matchy i will investigate forthwith! :good:


Nope. All scaling removed still only picks up the very central point.
« Last Edit: 2016-Jan-22 by monkeybot1968 »