Hey Li,
The suggestion should work on the face issue...
Set the cube to bothsides:true if you see the projection ok, and you have set the faces in right sequence order, then you are good for next step.

The point I think here is that you try render faces that are not in the loop, at some angles, you would need to see faces not in the renderlist of the object.
In other words, you want to see the mirrored dark side of the moon.
So you will need here to write a class that is a flipped clone of the original mesh and use that info. This should also increase speed since the faces would be ready to be used at any time. They also would have a front property instead of back property automatically.

For the shadow or fills case, may be another concept worth a try:
Take a look at the way the outline works. So instead of drawing whole geometry face by face, just collect the vertexes of the hedges, project them, and read on Render the list you've composed to draw once the whole shadow shape into your source destination. This would ensure almost same draw speed for simple or complex objects... and since your cast image also is a rectangle, you even could skip some vertexes if their are not included in that rect. Note that I haven't read your code, so you might do it already.

Just thinking loud here :)

Fabrice

On Sep 3, 2008, at 5:38 AM, Li wrote:

Fabrice: Ive been working with your suggestion with no success. Tryedas hard as I can.... The problem seems to be reduced to finding which faces to draw on the reflective plane. These are not the same faces as the ones drawn on the "real" object.

Question: Somewhere in the engine something is deciding which faces will be drawn. I suppose it makes this decision based on the objects position, if it is bothsided, etc. We need to apply this same logic to the "virtual" object this time, created in the reflection, and simply decide which faces will be drawn. Who makes this decision? And how does it create the appropiate DrawTriangle once it has been passed for rendering?

On Tue, Sep 2, 2008 at 7:09 PM, Fabrice <[EMAIL PROTECTED]> wrote:

well, its because you reverse the face and scramble it,
to flip a face with vertexes [a b c] , make it [ b a c]

as about the uv's they also required to be ordered.

       uva = new UV(0, 0);//downleft
       uvb = new UV(0, 1 );//topleft
       uvc = new UV(1, 1);//topright
       uvd = new UV(1, 0);//downright

but shouldn't have to change them since you want reversed image, just flip the face and you will be fine, otherwize if needed flip order uvs on the exact same way as vertexes following the same sequence.

Take a look at Lathe class, many examples of combinations in there.

//My head is about to explode!!
Take a break, you've done enough for today :))

Fab





On Sep 2, 2008, at 11:08 PM, Li wrote:


Ok, Im completely stuck here. My head is about to explode!!

You can see the problem I have in this DEMO:
http://www.piar.com.ar/li/away/reflections/theproblem/
As I tryed to explain before, im having problems when redrawing the
reflected object's materials on the plane. With wirecolormaterials Im
only having trouble with sorting, but with moviematerials Im also
having trouble with the orientation of the vertices in the
beginbitmapfill method.

Ive made a big effort to make the source organized and have lots of
comments, so, here it is: 
http://www.piar.com.ar/li/away/reflections/theproblem/AdvancedReflections.zip

I believe that if someone familiar enough with the engine's core grabs
this, the problem would be resolved easily and quickly... A little
help and we're done!

On Sep 2, 3:30 pm, Li <[EMAIL PROTECTED]> wrote:
Thanks Peter, and everyone else for the positive replyes...

Here it is with an jpeg as 
bumpmap:http://www.piar.com.ar/li/away/reflections/bumpwithimage/

On Tue, Sep 2, 2008 at 3:07 PM, Rob Bateman <[EMAIL PROTECTED]> wrote:
very cool! love it.

Rob

On Tue, Sep 2, 2008 at 6:56 PM, Jensa <[EMAIL PROTECTED]> wrote:

Awesome job Li! Keep at it!

J

--
Rob Bateman
Flash Development & Consultancy

[EMAIL PROTECTED]
www.infiniteturtles.co.uk
www.away3d.com



Reply via email to