View Full Version : 3D Collision
dangerskew
September 8th, 2004, 10:18 PM
I followed the tutorials to make some 3d stuff, and I was wondering, is it possible to make it so you can't walk through walls and such? .fla attached
Marz
September 9th, 2004, 01:47 AM
Yeah it is possible to do 3D collissions. It's rather difficult to explain but there is a process of doing it. First off, you would want to test 3d point allocations to your current position. So therefore, you would have to create a 3dhitTest. This hitTest would scan over not only x and y... but the z plane as well. Just as if you ere doing a complex 2d figure, you would test collission with multiple points, well, with the 3D figure, you would have to test with almost 3-6 times as many points... This could present a problem eh? :)
Just some random thoughts.
bhjodokast
September 9th, 2004, 03:36 PM
It's best to cheat for now and approximate it, in my opinion.
If you want to be more exact: the scaled percentage can tell you approximate Z-Level. So if the X and Y line up, and if Scale is +/- 10% of the position of the object, you score a hit.
If you don't scale your 3-D this way (faking perspective with scaled movieclips), you can keep track of it with another variable called ObjectZLevel. Check it against something like CurrentZLevel and ProjectileZLevel. I'm working on a new 3-D example to illustrate this better.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.