Jump to content

intersectMesh playgroung example ? my mistake or bug?


Kilombo
 Share

Recommended Posts

Good afternoon everyone,

 

I've beeing insisting in the past few days in this intersectMesh stuff. Nothing is working to me, so, I took one example from the tutorial, parcialy adapted it (badly by the way, eheheh) and there it goes.

 

In my example, the color of the sphere indeed doesn't change, because there's no intersection, although... he goes in the if clause, i know that because the var called targetz had a value of zero, and only changes to 50 if there's a intersection..... but there's no intersection! So? Why does it enter in the if clause and actually do some stuff, and other don't.

The ball should be red on there's one intersection, and yellow, if it doesn't.

 

Maybe i'm doing something really wrong, really not sure.

 

Please check my examples in the playgroung and check the console: http://www.babylonjs-playground.com/#KI6GH#1

 

I'm insisting on this, because i'm trying to implement one NPC (non player character) and the intersections are the key part for this.

 

Thanks in advance.

Link to comment
Share on other sites

Hi K!  Hi T!  Ahh yes, the very useful renderBeforeRender().  I use that puppy all the time.  :D

 

I'm pretty much confused, but here's #3.

 

I'm not sure what you are trying to do with this PG, Kilombo, but we got red balls, and that's something.  :) In order for an intersection to happen, the yellow ball needed to actually hit something, so I changed its animation path.  You also had paste mistakes in lines 29-31... but that didn't affect your intersections.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...