Flip faces

98 views
Skip to first unread message

Bas Van Zutphen

unread,
Mar 17, 2011, 5:40:36 AM3/17/11
to Away3D.dev
Hey guys,

First off; Thank you guys for creating the awesome open-source engine
of awesomeness that is away3D! I think I spotted a few of you at FITC
amsterdam last week (Fabrice ?), could be mistaken!

Anyways, I am trying out Broomstick and I want to create a simple
environment Cube. The old cube primitive had a .flip boolean that
would flip faces of a cube so that the faces are rendered from the
inside out. I can not find this feature in broomstick. Is it in the
making or will it never return?

Also, I see that the 'bothsides' boolean of mesh is also missing? I
hope these will soon return! in the meantime, do you have any tips on
a different way of solving this problem?

Cheers

Bas

John Brookes

unread,
Mar 17, 2011, 6:55:58 AM3/17/11
to away3...@googlegroups.com
Use skyBox class for environment cube

There is
MeshHelper.invertFaces(yourMesh);
but that throws an error for me.

Bas Van Zutphen

unread,
Mar 17, 2011, 7:03:49 AM3/17/11
to away3...@googlegroups.com
Thanks I might have to use that instead indeed!

However still, the invertFaces function works for me, but it breaks my cube

Here is what it looks like now: http://i54.tinypic.com/91di8l.png

2011/3/17 John Brookes <jbp...@googlemail.com>

Fabrice3D

unread,
Mar 17, 2011, 7:12:26 AM3/17/11
to away3...@googlegroups.com
I have updated this method 2 days ago... you still get an error (which one)?

Fabrice

Bas Van Zutphen

unread,
Mar 17, 2011, 7:30:24 AM3/17/11
to away3...@googlegroups.com, Fabrice3D
I updated my libs and now I get an error too:

Exception fault: RangeError: Error #3669: Bad input size.
    at flash.display3D::VertexBuffer3D/uploadFromVector()
    at away3d.core.base::SubGeometry/getVertexNormalBuffer()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\base\SubGeometry.as:192]
    at away3d.core.base::SubMesh/getVertexNormalBuffer()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\base\SubMesh.as:130]
    at away3d.materials.passes::DefaultScreenPass/render()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\materials\passes\DefaultScreenPass.as:359]
    at away3d.materials::MaterialBase/renderPass()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\materials\MaterialBase.as:309]
    at away3d.core.render::DefaultRenderer/drawRenderables()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\render\DefaultRenderer.as:184]
    at away3d.core.render::DefaultRenderer/draw()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\render\DefaultRenderer.as:99]
    at away3d.core.render::RendererBase/executeRender()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\render\RendererBase.as:305]
    at away3d.core.render::DefaultRenderer/executeRender()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\render\DefaultRenderer.as:88]
    at away3d.core.render::RendererBase/render()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\render\RendererBase.as:286]
    at away3d.core.render::DefaultRenderer/render()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\core\render\DefaultRenderer.as:79]
    at away3d.containers::View3D/render()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Away3D\away3d\containers\View3D.as:253]
    at Main/handleEnterFrame()[C:\Bas\Projects\oneparticle\Sandbox3D\Source\Classes\Main.as:142]



2011/3/17 Fabrice3D <fabr...@gmail.com>

Fabrice3D

unread,
Mar 17, 2011, 7:32:06 AM3/17/11
to away3...@googlegroups.com
just runned a test with a cube primitive, invertFaces works as expected.
are you sure you use the latest svn version?

Fabrice

John Brookes

unread,
Mar 17, 2011, 7:44:22 AM3/17/11
to away3...@googlegroups.com
I've updated just now and that error above is the one I get.
But only on a more complex mesh, just tested a simple mesh and it didnt throw an error.
Still trying to find if its me.

Also, just noticed I now get an error about material size not being same.
Do all the materails have to be the same size
eg they have to be all 256x256
or you can have any size as long as they are power of two and square.
As thats what I have and its throwing an error.

John Brookes

unread,
Mar 17, 2011, 7:57:23 AM3/17/11
to away3...@googlegroups.com
I think invertfaces doesn't like UVs that are in the same position.
Tried a cylinder from Maya with standard mapping (no overlap) and its fine.
Adjusted the UVs so that the top and bottom faces have the exact same UV values and then it throws the error above.

Bas Van Zutphen

unread,
Mar 17, 2011, 8:04:30 AM3/17/11
to away3...@googlegroups.com
I am also using the latest svn version and am only using a very simple cube with a bitmap material on it.
Without adding any material it works fine, but it throws the error when using a bitmapmaterial / colormaterial!

2011/3/17 John Brookes <jbp...@googlemail.com>

John Brookes

unread,
Mar 17, 2011, 9:00:00 AM3/17/11
to away3...@googlegroups.com
On the material warning, if I trace out
trace("WARNING: all material maps should have equal width and height.\n"+w+"\t"+_screenPass.diffuseMethod.bitmapData.width);
in defaultmaterialbase.as

I get
WARNING: all material maps should have equal width and height.
1024    256
My texture is 1024x 1024. If you use a 256 texture and you dont get that error.

Fabrice3D

unread,
Mar 17, 2011, 10:43:16 AM3/17/11
to away3...@googlegroups.com
yes thats probably it. I have commented previous version of the method. Was hoping for a faster method and all tests were ok using basic shapes.
will see if I can mix both in case of shared vertices.

Fabrice

Fabrice3D

unread,
Mar 17, 2011, 11:02:30 AM3/17/11
to away3...@googlegroups.com
its not throwing an error, its a warning.
because I got already a few mails from people having weird looking results. simply because their normalmaps were not having the same dimensions as the diffuse map.
but may be this should be placed in dedicated cases where it really matters.

Fabrice

John Brookes

unread,
Mar 17, 2011, 11:04:12 AM3/17/11
to away3...@googlegroups.com
ahh ok :)

laurid_meyer

unread,
Apr 27, 2011, 2:04:32 PM4/27/11
to Away3D.dev
Hi, I'm really stunned what is possible with away3D 4 and Molehill.
Thanks for giving us a prerelease so we can develop with this new
great technology.

I get the same Error like Bas Van Zutphen on a simple Cube with a
simple colorMaterial.
I have the latest SVN Trunk from 27.04.2011

Any solutions to this?

If this MeshHelper works the problem with the invert faces would be
solved, but what's about the bothsides property? Is it possible to
make a cube primitive two sided?

Thanks a lot!

Fabrice3D

unread,
Apr 28, 2011, 11:18:06 AM4/28/11
to away3...@googlegroups.com
myMaterial.bothSides = true;
its now set via materials and not as in previous engines set on meshes.
note also the "bothSides" < cap "S" vs old all lowercase "bothsides"

Fabrice

Reply all
Reply to author
Forward
0 new messages