PlaneGeometry.doubleSided=true;RangeError: Error #3669: Bad input size.

Software: Away3D 4.x

yue, Newbie
Posted: 29 August 2012 10:21 AM   Total Posts: 3

i create a mesh with PlaneGeometry and TextureMaterial(bitmaptexture).

and PlaneGeometry.doubleSided = true.

when view3d.render(),the error come:RangeError: Error #3669: Bad input size.

if i change doubleSided to false.

it works.

how can i fix it?

   

Smettie, Newbie
Posted: 10 September 2012 10:29 AM   Total Posts: 3   [ # 1 ]

I encountered a similar RangeError: [Error #1125: Index out of bounds] while listening for MouseEvent3D events when PlaneGeometry.doubleSided=true.

This is caused by an incorrect amount of the primitive’s uv coordinates. I fixed it by inserting this line of code in PlaneGeometry.as

override protected function buildUVs(target SubGeometry) : void
{
    
var uvs Vector.<Number> = new Vector.<Number>();
    var 
numUvs uint = (_segmentsH 1) * (_segmentsW 1) * 2;
     
    if (
_doubleSidednumUvs *= 2

[EDIT]
Although this fixes the RangeErrors, it will not correctly calculate the uv coordinates and therefor still display the texture incorrectly.

   

Smettie, Newbie
Posted: 10 September 2012 10:29 AM   Total Posts: 3   [ # 2 ]

same issue btw: http://away3d.com/forum/viewthread/2930/

   

Mark Caz, Newbie
Posted: 05 October 2012 09:15 AM   Total Posts: 4   [ # 3 ]

there’s a hacky fix for it assuming you just want a 2 sided plane.

create a second mesh identical to your first, then rotate it 180, and add it to the first:

mesh1.addChild(mesh2); 

voila, double sided plane.

EDIT: as suggested in the link above! Wasn’t sure where I’d read that fix.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X