Flash 10 vs Silverlight 3: Perspective 3D Silverlight Photo Explorer 1.0
May 13

Hi Guys! I am back. Sorry for disappearing for more than a month. I am busy with one of my personal project Pencake Free Ecard. You may use the application I build using Flash to Create your own Ecard. Take a look, I believe you will be interested on that.

Anyway, today I will bring you a 3D Image Slideshow using the perspective 3d technology in both Flash and Silverlight. Implementing this effect in the past is not that easy. However, thanks for the advancement of the technology, you may now create it on the fly.

Images used inside the applications are all collected from Pencake Ecard Website.


Comparison

Flash implementation: 1 hour

Silverlight implementation: 40 minutes (Implemented First)

What’s the difference:

  • DisplayObject.z vs PlaneProjection.LocalOffsetZ / GlobalOffsetZ

Source codes

 

Flash

Silverlight

Flash: DisplayObject.z vs

In Flash, you may use the z property to modify the Z position of an object. However, setting the z property doesn’t mean that the objects will be sorted by the z value. The display order of the UI objects are still governed by the item added order. This is a big issue since you will have no idea which object should be on top after applying rotationX, rotationY or rotationZ.

You will find that I have done some simple hacking in my code to solve out the z-index problem.

Actually, I don’t fully understand the mechanism of perspective 3D in Flash. May be there are some solutions that could help us to solve out the sorting problem.

Silverlight: PlaneProjection.LocalOffsetZ / GlobalOffsetZ

Silverlight seems to have a more powerful perspective 3D capability. Firstly, items applied with perspective 3D will be sorted automatically. We don’t really have to do any calculations. Sorting is done perfectly even we have applied RotationX, RotationY or RotationZ properties.

Secondly, Silverlight provides two properties LocalOffsetZ and GlobalOffsetZ for us to set the z position of an object. This is very useful since it allows us to rotate an object with respect to another origin defined by the GlobalOffsetZ, GlobalOffsetX and GlobalOffsetY. Unlike Flash, it can only rotate with respect to a fixed origin. But of course, we could still solve this problem in Flash by some nested children method.

// C#
// create a new projection
PlaneProjection planeProjection = new PlaneProjection();

// create a new image
Image image = new Image();
image1.Source = new BitmapImage(new Uri("image_path.jpg", UriKind.Relative));
image1.Projection = planeProjection;

// rotate 90 degree with respect to the center of an image
planeProjection.RotationY = 90;

// rotate 90 degree with respect to the origin which has z value of 100 behind the image
planeProjection.RotationY = 90;
planeProjection.GlobalOffsetZ = -100;
planeProjection.LocalOffsetZ = 100;

Shares and Enjoy~

Did you like this post?

Subscribe here:  

22 Responses to “Flash vs Silverlight: Image Slide Show using Perspective 3D”

  1. Ai_boy Says:

    Silverlight going better and better. I love Microsoft beacose of this tecnology. But HATE beacose of Outlook! :)))

  2. Wahab Says:

    Let see. Silver Light version aren’t backward compatible. If you develop a SV application and new version get released. You need to create a new application in new version

  3. Dowell Says:

    Silverlight is backward compatible. But you cannot play newer application in old Silverlight players (and neither can Flash).

  4. Technology Related Links for May 13th - Jason N. Gaylord's Blog Says:

    [...] Flash vs Silverlight: Image Slide Show using Perspective 3D (Suggested by Silverlight News) [...]

  5. Bill Sithiro Says:

    Actually you can run a SL3 compiled app in SL2. It will work until it hits something not implemented in SL2. Not that it’s advisable, but just in case you needed to know.

  6. Pete Says:

    @Wahab

    Silverlight has a VERY high bar for backwards compatibility between versions. Silverlight 3 RTW will run all the same apps Silverlight 2 RTW would run. Not sure where you got your information about backwards compatibility, but it is incorrect.

  7. Ai_boy Says:

    @Pete

    He is a Flasher maybee. And it’s a malignant envy :)

  8. Links da Semana (18-22) - Gonçalo Chaves - XAML PT Says:

    [...] Prespectiva 3D entre Silverlight e Flash -  não querendo alimentar comparativos, um exemplo de comparação directa entre as duas tecnologias. [...]

  9. ry Says:

    Hi, you are really great at what you are doing—programming. However, I really wished the site could be be more relevant, Come on, do you think people with flash player even download Silverligt just to compare? Of course not. In reality people won’t install something that does the same thing. People vote for Silverlight or Flash because of vested interests. Not because one is better. So the primary purpose of this site is practically useless. Such a talent wasted.

    Besides, when Flash releases its new version , it would top Silverlight and when Silvelight launches a new version, it would probably be better than FLASH. So some of the comparisons would be obsolete eventually.Besides who cares about subtle differences? Why not make this site a tutorial site—with FL and SL sections–explain every line. Then this site would be more useful and would have a purpose.

  10. Top-silverlight » Blog Archive » Flash vs Silverlight: Image Slide Show using Perspective 3D Says:

    [...] origin. But of course, we could still solve this problem in Flash by some nested children method. view plaincopy to [...]

  11. Silvelright Resources Directory Update (11 Aug) Says:

    [...] Original Post [...]

  12. hasfa Says:

    Silverlight going better and better. I agree. Brilliant Microsoft technology but i really mad of IE brows.
    Thanks Gusy for that article.

  13. hasfa Says:

    Hi guys.I have receive ur email. Thanks. what u did here is a good well tutorial for me and those who
    as a web designer.

  14. admin Says:

    hasfa, thanks for your appreciation. I hope you can find good resources in this site.

  15. Luis Neto Says:

    Hi. I’am a little new with this stuff and i wan’t to know how i can change the photos on the player…

  16. hasfa Says:

    Thanks for the email. actually..I also heard that flash is not suitable for googlebot and make the web going slow appear. Is it true?

  17. Mahesh Says:

    This is pretty cool!. Thanks for sharing.

    Can the images be hyperlinked in silverlight? Also, can the slideshow time be set? to increase or decrease?

  18. 3D Image Slide Show | Silverlike - A Free Microsoft Silverlight 3 Directory Says:

    [...] Terence Tsang is proud to present you a 3D Image Slideshow using perspective 3d. You are able to add more images into the controls. [...]

  19. Andrew Pelt Says:

    I am loving yout dating adventures.

  20. Free Streaming Movies Says:

    Nice! Awesome!

  21. date a millionaire Says:

    This is a real good resource that you’re providing and you also give it away free of charge. I like to see sites that recognize the value of offering a outstanding resource for free. I really loved reading through your article. Cheers!

  22. Stormy Says:

    Flash click > CPU % 2 or %1

    Silverlight Click > CPU &16 or %23

    hehheee :)

Leave a Reply