Wave Modifier example

37 views
Skip to first unread message

themightyatom

unread,
Apr 15, 2011, 9:41:03 AM4/15/11
to Away3D.dev
Friday afternoon, waiting for models from a customer, nothing to do
but play :)
(then work all weekend to make the monday deadline, sigh)

http://videometry.blogspot.com/2011/04/wave-modifier.html

Once I'd found out how to access and manipulate UV's it seemed like
vertices
where the next logical target. I'm sure in time modifiers will be
written into
Broomstick in a much smarter way that uses the GPU, but for now why
not
write modifiers the good old fashioned way, in plain Actionscript?

Cheers,

Pete

Peter Kapelyan

unread,
Apr 15, 2011, 10:15:11 AM4/15/11
to away3...@googlegroups.com
It's weird, if you make the aplitude pretty high, and turn the model around, it seems the model is inverted or Z sorting is working backwards?
--
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

themightyatom

unread,
Apr 15, 2011, 11:12:00 AM4/15/11
to Away3D.dev
I know what you mean. It's a double sided material on a plane, but the
normals should tell it which face to render.
Are there any face culling options to try?

Could also be that I've mucked up the UV's trying to make the grid,
but by default the interface opens with the UV's automatically
assigned by the Plane constructor, and I see the same weirdness.

Peter Kapelyan

unread,
Apr 15, 2011, 11:20:55 AM4/15/11
to away3...@googlegroups.com
I'm not sure what's going one but it's weird, maybe a possible bug or the way you are doing that? Also I saw some triangles get screwy/zigzagging into each other. I could try to snap a screenshot if you didn't see that.

-Pete

themightyatom

unread,
Apr 16, 2011, 1:27:52 AM4/16/11
to Away3D.dev
I had a look into SubGeometry class, and couldn't find a simple fix.
All the buffers appear to be invalidated when you use
updateVertexData, which is as it should be.
(was hoping normals needed to be rebuilt)

I did notice this comment "// todo: send out bounds invalid"
I don't know how the bounds are used, or indeed if they are used at
all further down the pipeline, but maybe it has something to do with
the bounds changing?

Any suggestions very welcome :)

themightyatom

unread,
Apr 16, 2011, 3:04:22 AM4/16/11
to Away3D.dev
Cracked it!

TIP: If your material map isn't transparent, don't use
transparent=true!
Setting bothsides=true, and transparent=true has the effect of
flipping the normals and creating other artefacts.

I tested with the primitives example, and it proves the point.
http://videometry.net/broomstick/Prims.html

Whether this is a symptom of Away3D 4 being in alpha, Molehill being
in alpha, or just "the way it is" time will tell.

In theory you should be able to have a material with alpha channel,
visible on both sides of a plane, without this occurring.
For now it's a gotcha worth knowing :)

All sources have been updated and available for download here:
http://videometry.net/broomstick/WaveModifier.html

John Brookes

unread,
Apr 16, 2011, 12:26:22 PM4/16/11
to away3...@googlegroups.com
Just setting an alpha on the material seems to have an issue with z sort

4 spheres
var ballMat:ColorMaterial = new ColorMaterial(0xffffff,0.8);
var ball:Sphere = new Sphere(ballMat);
ball.position = camController.camera.position;
ball.moveForward(300);
scene.addChild(ball);

var sMat:ColorMaterial = new ColorMaterial(0xff0000,0.2);
var s:Sphere = new Sphere(sMat);
scene.addChild(s);

var s1Mat:ColorMaterial = new ColorMaterial(0x00ff00,0.2);
var s1:Sphere = new Sphere(s1Mat, 100);
scene.addChild(s1);

var s2Mat:ColorMaterial = new ColorMaterial(0x0000ff,0.2);
var s2:Sphere = new Sphere(s2Mat, 150);
scene.addChild(s2);


If you rotate the camera so the white ball is just behind the outer blue. The center red sphere shows through.

http://www.shrewballooba.co.uk/Alpha/

Peter Kapelyan

unread,
Apr 19, 2011, 9:43:49 AM4/19/11
to away3...@googlegroups.com
Nice bug find!
Reply all
Reply to author
Forward
0 new messages