pseudo 3D/2.5D Effect Flash AS2

This is the place to post your own creative works for other to play or give feedback on!
Forum rules
This forum is for posting and collaborating upon third party work. Please do not post request-threads, and avoid posting artwork that is not your own unless it is being used as a reference.

Re: pseudo 3D/2.5D Effect Flash AS2

Postby FMPraxis » Tue Nov 13, 2012 2:07 pm

I've just blown off the eight hours i should have been sleeping to write some code, is this close to the skew effect you were looking for?:

Spoiler (click to show/hide):

Click to Play
(Javascript Required)

pseudo3D(AS3).swf [ 1.57 KiB | Viewed 2600 times ]



Although I wrote it in AS3 the main code for doing the actual skewing should be basically the same:
Spoiler (click to show/hide):

Code: Select All Code

matrix
=box.transform.matrix.clone();
if((
varix>&& variy>0) || (!(varix>0) && !(variy>0))){ //if varix and variy are both positive or negative
   matrix.c= Math.abs(varix/2200) //multiplied the stage size by four, feel free to play with the numbers. abs to always return a positive value
   matrix.b= Math.abs(variy/1600);
  }else{//if  varix and variy are not both positive or negative
  matrix.c= Math.abs(varix/2200)*-1//same thing, but always return a negative value.
  matrix.b= Math.abs(variy/1600)*-1
}
box.transform.matrix=matrix


the matrix is just a copy of the transform matrix from the box.


[Edit]
I just realized that that code is technically wrong. instead of checking if varix and variy are both positive you should be checking box.x-275 and box.y-200. in my case it does basically the same thing because my box is more or less exactly in the center, but if you want your box off to one side, you need to check its x and y position instead of the mouse's.
FMPraxis
 
Joined: Mon Jun 25, 2012 10:14 am

Re: pseudo 3D/2.5D Effect Flash AS2

Postby KaTsuO_O » Thu Nov 15, 2012 5:27 pm

@FMPraxis yeah, that's pretty much what I meant. I needed it to only skew vertically and the top of the symbol should skew away from the center, but it is all in there, just a few changes needed.

The code worked perfectly when I tested it in an as2 project. However, I'm not sure how I could get it to work like I wanted.

It's a shame that I don't need this anymore but I still really appreciate that you took your time to get it to work. I hope you keep helping people with these kind of problems, it may just be a project breaker sometimes.
Don't create a porn game if you're only interested in porn.
Wise words regarding criticism http://www.youtube.com/watch?v=-98ZFl1sKt4
User avatar
KaTsuO_O
 
Joined: Tue Nov 02, 2010 6:03 pm

Re: pseudo 3D/2.5D Effect Flash AS2

Postby FMPraxis » Thu Nov 15, 2012 8:54 pm

I'm glad that the code worked, it's too bad that you couldn't use it but maybe I can find some other things this would be useful for, maybe a parallax scrolling engine, but thank you for asking about this because it gave me a good opportunity to actually read the documentation on transform matrices.

I'm sure that if and when i see others with problems like this, I'll certainly do my best to help them out as well, I have always tried to help with problems when I think I can.
FMPraxis
 
Joined: Mon Jun 25, 2012 10:14 am

Re: pseudo 3D/2.5D Effect Flash AS2

Postby hat973 » Wed Aug 28, 2013 9:52 pm

im just wonder but couldnt you use the 3D effect on flash to make a world like HTH I'm just asking because thats what got me in to working on flash trying to make a world like crowchild makes on High tail hall
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Previous

Return to Creative Corner



Who is online

Users browsing this forum: No registered users