A Flash Developer Resource Site

# Thread: need a 3D code

1. ## need a 3D code

Ok, this one will seem a little wierd, im trying to get an instance to move in a 3D static (does not move) back ground. How would i get it so that when the instance moves further away, it becomes smaller, and will move slower. The instance will be a person walking, and will be controllable to the user.

If you could help with this lil prob., then women will want to have sex with you

2. The "z" distance is a linear relationship, so to do that, relate the y position of the mouse to the x & y scale of the movie clip.

setProperty("movie", _yscale, _ymouse);
setProperty("movie", _xscale, getProperty("movie", _yscale));

To acheive the paralax effect (objects moving slower when far away, and vice versa) relate the x position of the mouse to the scale of the movie clip. This determines the x position of the movie clip.

xpos = getProperty("movie", _xscale)*(_root._xmouse)/(550);

Note: The Mouse position should be divided by the Movie size, otherwise the clip will shoot off of the screen.

Hope this helps.

-Swim'nSasquatch

3. if you keep using getProperty and setProperty, women will not want to have sex with you.

4. That's too bad. , but good news for my wife

5. I like to use this equation:
_x=(x-x0)*N/(M+z)-PX0;

For a static picture, we need to calculate out the co-efficients:
x0,N,M and PX0;

I draw a 3d sqaure in the picture and pick 4 points to solve the equation mentioned above.

Here is the fla if anyone is interested.

#### Posting Permissions

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

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap

Click Here to Expand Forum to Full Width