Results 1 to 2 of 2

Thread: Coding Issue that involves Math!

  1. #1

    Coding Issue that involves Math!

    Hey, I'm coding something for a website, however, i'm stuck on a bit of Maths which is involved.

    I will try my best to explain the issue. Let's say there are 3 layers, each of which occupies the same area, however, they move at different speeds depending on their "depth", so due to them being further away from the "camera" we need to adjust their size.

    container height: 500.
    window height: 860.

    layer 1 depth: 1.0 (this is basically unchanged, so it's height should remain at 500).
    layer 2 depth: 0.5
    layer 3 depth: 0.1

    So, let's say that 0.1 means that this layer needs to be 90% the size of the window height, however the calculation needs to account that 1.0 will simply be the size of the container...

    If this doesn't make sense let me know and I will try and find a visual aid.

  2. #2
    Elite Member stapel's Avatar
    Join Date
    Feb 2004
    Posts
    15,540

    Cool

    Quote Originally Posted by martynball View Post
    Hey, I'm coding something for a website, however, i'm stuck on a bit of Maths which is involved.

    I will try my best to explain the issue. Let's say there are 3 layers, each of which occupies the same area, however, they move at different speeds depending on their "depth", so due to them being further away from the "camera" we need to adjust their size.

    container height: 500.
    window height: 860.

    layer 1 depth: 1.0 (this is basically unchanged, so it's height should remain at 500).
    layer 2 depth: 0.5
    layer 3 depth: 0.1

    So, let's say that 0.1 means that this layer needs to be 90% the size of the window height, however the calculation needs to account that 1.0 will simply be the size of the container...

    If this doesn't make sense let me know and I will try and find a visual aid.
    I, for one, am quite lost. What are you actually trying to accomplish?

Bookmarks

Posting Permissions

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