How to solve Triangle Collision Error at 3ds model ?

Software: Away3D 4.x

edgar, Member
Posted: 26 April 2012 01:02 PM   Total Posts: 52

Hello,

I have a handheld casing as 3ds model with front, back, display, keyboardmembrane and Top Cover, Bottom Cover.

My idea is to put mouseOver and mouseOut for each of those meshes.
But I get an error Null Object showing me the following file section

public function get collisionUV():Point {
  if( !_collisionExists ) return null;
  var indices:Vector.<uint> = _collidingRenderable.indexData;
  var uvs:Vector.<Number> = _collidingRenderable.UVData;
  var index:uint = _collisionTriangleIndex;
  var v:Number = _kernelOutputBuffer[ index + 1 ]; // barycentric coord 1
  var w:Number = _kernelOutputBuffer[ index + 2 ]; // barycentric coord 2
  var u:Number = 1.0 - v - w;
  var uvIndex:uint = indices[ index ] * 2;
  var uv0:Vector3D = new Vector3D( uvs[ uvIndex ], uvs[ uvIndex + 1 ] );
  index++;
  uvIndex = indices[ index ] * 2;
  var uv1:Vector3D = new Vector3D( uvs[ uvIndex ], uvs[ uvIndex + 1 ] );
  index++;
  uvIndex = indices[ index ] * 2;
  var uv2:Vector3D = new Vector3D( uvs[ uvIndex ], uvs[ uvIndex + 1 ] );
  _collisionUV.x = u * uv0.x + v * uv1.x + w * uv2.x;
  _collisionUV.y = u * uv0.y + v * uv1.y + w * uv2.y;
  return _collisionUV;
  }

Any idea, how to put different meshes to one model and having the possibility to have mouseOver and mouseOut for each of those meshes?

 

 

File Attachments
handheld.3ds  (File Size: 832KB - Downloads: 0)
   

rcarcasses, Newbie
Posted: 29 April 2012 05:50 PM   Total Posts: 2   [ # 1 ]

I’m having the same problem..

   

edgar, Member
Posted: 29 April 2012 05:53 PM   Total Posts: 52   [ # 2 ]

I solved it. The problem was that the uv did not match to 0 and 1. I unwrapped the mesh in Blender with Smart UV Project. Changed the faces from quad to triangle. Then it worked.

Regards
Edgar

   

rcarcasses, Newbie
Posted: 29 April 2012 05:55 PM   Total Posts: 2   [ # 3 ]

Thank you Edgar, I was about to attempt something similar with 3d max. I’ll try your solution as well if I don’t succeed.

Kind Regards,
Robert

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X