instersetcs function returning non intersecting planes

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  4 Weeks Ago
instersetcs function returning non intersecting planes

Hi guys! I have "pile of planes" and I need to find out all intersections between these planes. I have wrote following piece of code to give me list of all planes and planes their are intersecting with. Problem is that intersects function is returning me also planes that are not intersecting with current one. Do you know whats wrong there? Where I made mistake or misunderstood something?

Also I use array to store intersecting planes, this array i put into dictionary, but if I free this array after setting it into dictionary, values in dictionary are empty. Why is this happening?

Thanks for help!


for i = 1 to planes.Count do 
(
      currentPlane                                     = planes [i]
      currentPlaneName                            = currentPlane.name as name
      planesInfo [currentPlaneName]    = undefined

      for y = 1 to planes.Count do
      (
            collisionCandidate = planes [y]
      
            if currentPlane.name != collisionCandidate.name then
            (
                  if intersects currentPlane collisionCandidate == true then
                  (
                        appendIfUnique collidingPlanes collisionCandidate.name

                  )
            )
      )
   
      SetDictValue       planesInfo currentPlaneName collidingPlanes   
      free                collidingPlanes
)
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:50 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.