Home Technical Talk

3DSMax: How to get One-toOne Render

Hello all,

For my team's current game project, the designers are blocking out levels in 3DSMax. The level collisions are made of 40x40 squares. This is consistent throughout the whole game.

It's my job to render out the collision layout and send the artists the png file for them to paint over. I then get the art back, and import the art into 3DSMax as large planes.

The problem is, the renders I do are never perfect, they are always distorted in such a way that the squares are perfectly 40x40 at the beginning, but later on in the image, they are not 40x40.

I've tried using both the default Front Camera and my own Free Orthographic Camera, but I cant get consistent results.

Any help will be greatly appreciated!

Replies

  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    This is a trigonometry problem, you just have to find the right-angled triangle between your cam and your 40*40 square.
    Create a free ortho cam.
    Put a square resolution in the render settings.
    Chose a random FOV, let's say 50°.
    How far must be the target ?
    20/tan(25) = 42.89
    So put that in the target distance, and it should be good.

    Then move your camera from your square center to square center, and render.
  • walterlow
  • CynicConn
    Options
    Offline / Send Message
    Thank you Noors and waterlow for getting helping me out here. I knew there has to be some sort of formula based on the camera distance, orthographic projection, and render size!

    waterlow, I've taken look at the article, thanks again. Its a great example of walking through how to get a perfect render for isometric views, but since we are making essentially a 2D sidescrolling perspective, I'll have to change up how they do it.

    Noors, can you please elaborate more on the formula for finding the right angle triangle. Now, I remember Soh-Cah-Toa from back in high school and college, but I'm not sure what exactly the opposite edge would be. Is it the height of the whole collision level, or the FOV etc?

    Yesterday, I was able to get a very close perfect render by making a ortho camera and through trial-and-error, found the best target distance to set it at. In this case 483 (go figure)!

    Thanks again guys
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    There, cba to plug my tablet
    trigo.jpg
  • CynicConn
    Options
    Offline / Send Message
    Hey Noors, thanks for the really helpful graph and the quick reply :)

    I've NEVER been great at Math, mostly because I overthink things. Can you please run through with me what I'm doing wrong.

    So, I measured, the length of the level is exactly 23120 pixels. I set my orthographic camera to FOV 50. I set my calculator to degrees.

    0.5 * 23120 = 11560
    tan( 0.5 * FOV) = 0.4663
    11560/0.4663 = 24790.91

    So, I set my targetdistance of my ortho camera to 24790.91

    I'm rendering out a 16,000x16,000 image. My render is also rendering out a bunch of empty space around the level. Is that my problem? Or is it something else foolish I did/didnt do?

    Thanks again
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    I get 24790.50
    23120 pixels ? Do you mean units ?
    I've made a 23120 meters square and with 24790.50 it's perfectly fine.
    Do you check orthographic projection ?
  • CynicConn
    Options
    Offline / Send Message
    Hey Noors, When I say 23120 pixels, its literally pixels. Each square is a 3DSMax box. There are 578 squares. Which would total 23120 pixels wide. Just to be clear, the level is not not purely flat, its so up and down too. I didnt measure exactly how tall, but the level is at least 300 squares tall.

    When you say your 23120 square renders out perfectly fine Noors, do you mean that it is perfectly one-to-one throughout? Because when I would bring my renders to Photoshop, and measure the width of a square, it would be perfectly 40, but then further down the render, squares would clearly be rendering vertically. I turn on the pixel grid in photoshop and set it to 40 pixels per square.

    What were your render settings. I simply render out the whole view from my ortho camera. And yes, I definitely checkmark ortographic projection.

    Thanks for patience on helping me out!
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    Nope i don't get it. You have to mesure the physical length of those boxes in max. A pixel doesn't make any sense. It could be mapped to anything.
    "squares would clearly be rendering vertically" I don't get the meaning of this either.
    Make a drawing or a snapshot of your scene coz i'm affraid i cant picture it.
  • CynicConn
    Options
    Offline / Send Message
    Alright, I uploaded a screenshot of a render I did of the level. As you can see, the level is does not follow a straight path. The level is made of boxes that are 40x40 units (meters) or multiples or 40x40 such as 240x40.

    I hope this helps explain my situation a bit more. Im trying to render out the collisions, so the artists can paint an environment based on the collisions, and when we import planes with textures of the art assigned to their materials, it will match perfectly. When I do renders though, its never ever ever renders completely one to one.
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    Ok, so we agree 1meter in max should be 1pixel in the render.
    So get the bounding box size in meters in max
    trigo2.jpg
    in your original pic, 1928*321
    Do the same calculation, to know how to set the cam.
    with fov 50, target dist = 964/tan(25) = 2067.3
    Place the cam at the center of the plane.
    In the resolution settings, enter 1928*321
    There you go, 1meter=1pixel.
  • CynicConn
    Options
    Offline / Send Message
    Thank you for your help Noors. The last thing I wasnt sure about was what the render size should be. But, with this last example, you specified to make it the exact size of the level layout!

    Thanks Again :)
Sign In or Register to comment.