brlrt / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

Sphere.segmentsW and Sphere.segmentsH can not be setted to lower values after the first display #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I think that the Sphere is not totally reset after changing segmentsW
and/or segmentsH, using Away3DLite 1.0.0 or the trunk at revision 2261.

There is no visible problem if the new values are greater but there is the
following error if the new values are lower:
ArgumentError: Error #2004: L'un des paramètres n'est pas valide.
        at flash.display::Graphics/drawTriangles()
        at flash.display::Graphics/drawPathObject()
        at flash.display::Graphics/drawGraphicsData()
        at away3dlite.core.render::FastRenderer/collectFaces()[D:\workspace
\Away3DLite_trunk\src\away3dlite\core\render\FastRenderer.as:90]
        at away3dlite.core.render::FastRenderer/collectFaces()[D:\workspace
\Away3DLite_trunk\src\away3dlite\core\render\FastRenderer.as:40]
        at away3dlite.core.render::FastRenderer/render()[D:\workspace
\Away3DLite_trunk\src\away3dlite\core\render\FastRenderer.as:185]
        at away3dlite.containers::View3D/render()[D:\workspace
\Away3DLite_trunk\src\away3dlite\containers\View3D.as:537]
        at away3dlite.templates::Template/onEnterFrame()[D:\workspace
\Away3DLite_trunk\src\away3dlite\templates\Template.as:93]

I think that the error message is in english: "ArgumentError: Error #2004:
One of the arguments is not valid."

Here is an example showing the bug with a simple sphere defined like that:
  var mySphere:Sphere = new Sphere(new
BitmapFileMaterial("assets/texture.jpg"), 1000);
  mySphere.sortFaces = true;
  scene.addChild(mySphere);

Then, depending on the distance between the sphere and the camera, I
change mySphere.segmentsW and mySphere.segmentsH and the bug occurs when
the new values are lower.

Since I've created a real issue, I just want to say you that in
Template.onEnterFrame there is a missing coma after the title in the
debugText (compare with the "title" setter) and I think that the title
setter should be called instead of this line duplicated.

Thanks for this library that seems to be very good!
We are looking to it for adding 3D behaviours to the OpenScales GIS project
(http://openscales.org).

Regards,
Aurelien Barbier-Accary

Original issue reported on code.google.com by aurel...@barbier-accary.info on 21 Feb 2010 at 8:10

GoogleCodeExporter commented 8 years ago
I can confirm silimar results.  My test created a sphere with 30 segements for 
both 
W and H values then as a result of a mouse click I set them to half that using 
(30 * 
0.5).  The result was an exception.  Here is the stack trace at time of 
exception:

RangeError: Error #1125: The index 2882 is out of range 768.
    at away3dlite.core.clip::RectangleClipping/collectFaces()
[..src\away3dlite\core\clip\RectangleClipping.as:30]
    at away3dlite.core.render::BasicRenderer/collectFaces()
[..src\away3dlite\core\render\BasicRenderer.as:48]
    at away3dlite.core.render::BasicRenderer/collectFaces()
[..src\away3dlite\core\render\BasicRenderer.as:43]
    at away3dlite.core.render::BasicRenderer/collectFaces()
[..src\away3dlite\core\render\BasicRenderer.as:43]
    at away3dlite.core.render::BasicRenderer/render()
[..src\away3dlite\core\render\BasicRenderer.as:182]
    at away3dlite.containers::View3D/render()
[..src\away3dlite\containers\View3D.as:473]

Hope this helps.

-=ben

Original comment by mirsw...@gmail.com on 11 Mar 2010 at 10:03

GoogleCodeExporter commented 8 years ago
fixed in teh latest update ot the trunk source:

http://code.google.com/p/away3d/source/detail?r=2672

Original comment by rob.bate...@gmail.com on 4 Jul 2010 at 6:17