Author Topic: Edit VertexBuffer issue  (Read 9697 times)

John Byrne   «   on: July 10, 2012, 12:42:15 PM »
Hi, 

I've got a few things I'm trying to do, and I can't seem to get them right.
1. Keep a background plane normal to the camera and the same size as the cube in front, adjusting for rotation. At the moment the code I have is:








mesh.x = _cube.x;
         mesh.y = _cube.y;
         mesh.z = _cube.z;
         mesh.lookAt(_cube._scene.camera.global.position.x, _cube._scene.camera.global.position.y, _cube._scene.camera.global.position.z);
         mesh.rotateX(90);

But this doesn't account for when the cube in front rotates along it's axis.
2. In relation to above, is there any way to edit the vertices of a shape? I've tried but it doesn't seem to actually update the on-screen result. Do samples like this: 
http://wiki.flare3d.com/index.php/Modifying_Surfaces
refer only to modifying the filter, but not the vertexes themselves? Here's a sample of what I have a the minute, but it doesn't actually update the on-screen mesh: 
http://pastebin.com/NLtnXsxr

3. Is there currently anyway to fix the issue with Flex not letting MouseEvent3D events through to the 3D models?

Ivan Vodopiviz   «   Reply #1 on: July 13, 2012, 11:11:46 AM »
Hi John, sorry for the delay:

I'll try to answer your questions in order.

1. I'm not sure I'm understanding correctly what you want to do, but wouldn't adding the cube as child of the plane or vice-versa help? That way you'll be able to rotate a single pivot3d object and its children will rotate relative to the parent.

2. I think there's only one little thing missing from your code, you need to force recalculation of the numTriangles property, something like this:

surface.numTriangles = -1;

You can find a complete example here.

3. Yes. Unfortunately, fixing that also makes event to arrive to the Stage3D even when you've clicked over a Flex button and we haven't found a way to stop that from happening. I put together a small, rather basic example you can download here. Please note that it's a FlashBuilder 4.6 project and you have to provide your own Flare3D SWC.

Cheers,