dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Bringing textures to 3d shapes?

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Bringing textures to 3d shapes?

    I have run across a few flash applications that have some 3d objects. I have read that it is nearly impossible to texture the faces of such objects. However, i believe i have discovered a way how this can in fact be done. I am currently going into direct X programming, but I don't just use the built in direct X functions for manipulation, i try to create my own. I came to think that there must be a way to bring a full 3d environment into flash. While flash itself does not work this way, the simply truth is, that even 3d applications display objects in two dimensions in the end. Others have even created action script files to provide a third dimension. I do not know the power of this action script, but I believe it can be used to bring a full 3d environment into flash itself.

    Back to my point. The idea is to use distortion to pseudo fit the displayed face. Photoshop itself seems to handle image morphing with an invisible 3d dimension, and flash does not. When you distort images in photoshop, it 'fits' the image as if it was in a 3 dimensional space that is portrayed at that perspective. flash simply moves the corner to another spot not touching the filled in pixels.

    I have run across an algorithm that does just this at http://www.ddj.com/cpp/184401431?pgno=1 the algorithm is written in C++ and is not directly usable as action script. However, flash has pseudo bitmap streaming capabilities. I have looked at the action script index and it seems to have all the appropriate functions to be able to achieve a 3d texturizing affect by overlaying a distorted(bit fitted) bitmap over the desired face of the object using that algorithm.

    That algorithm will work for starters, but it is not a true perspective fit, simply a image morph. Photoshop has the proper code required to achieve a proper prospective fit, but it is probably under patents and not available. The difference is that in photoshop, when you perform these morphs, the image isnt simply morphed such as in this algorithm, it is actually put into perspective as if it was on a 3d space and appropriately does pixel stretches. (linear vs perspective) To simplify it, with the linked code, the middle pixel of source image would be the middle pixel of destination face, however, in true 3d environment, that middle pixel from the source would not apear to be in the middle on an angled face, but either closer or further, in respect to the angle of the face. With a better morphing algorithm(such as in photoshop) a true 3d environment can be brought into flash.

    Let me know your thoughts, for the most part i am new to flash(i have messed with it a few years ago but didn't get into any depth) and feel it would be something fun to get into. At this stage i have all information i need, simply not enough experience to try this yet.

  2. #2
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Ah well, indeed you are right in saying texturing can be done :P it's actually been done already in flash by several engines now. Look up alternativa 3D for probably the best example of 3D done in flash.

  3. #3
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    916
    yeah man, you're like 8 years late.
    who is this? a word of friendly advice: FFS stop using AS2

  4. #4
    Junior Member
    Join Date
    Jun 2009
    Posts
    3
    eh, as i said, not been around flash for quite some time, but last i remember, people where thinking it was nearly impossible to do 3d texturing but bleh, seems as though its not a problem anymore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center