Results 1 to 23 of 23

Thread: Perspective

  1. #1

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Does anyone here know some math or where I could get the math for making pictures looking like they had a perspective?

    (little bit like texturing, but only in an own graphics program?)
    Sanity is a full time job

    Puh das war harter Stoff!

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I don't understand what you mean. Do you mean like drawing a cube with lines so that it has some perspective? Only with more complicated stuff.
    Harry.

    "From one thing, know ten thousand things."

  3. #3

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    No, not more complicated at all!
    I only want to have pictures between the lines, like texturing, but I want to know how to calculate how I can give perspective to the pictures.
    Sanity is a full time job

    Puh das war harter Stoff!

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    Does the bitmap need to be altered?

    With respect to distance from point of origin I mean.


    I think I have a good book that will help in either case.
    But with your knowledge of DirectX, I presume you only need
    help in working out the modified shape of the region you
    want to stretch a texture over?


    I'll see what I can find in a couple of hours when I get to work.

    Cheers
    Paul Lewis

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hey, it's ok, he got my 3disotiler project for sloped tiles
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    Smile Ok...saves me looking it up then

    Cheers
    Paul Lewis

  7. #7

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    NO! I still need some other stuff! PAUL!!! The tiler is a nice piece of programming, I want want some more stuff in my program. So I still need advice!
    Thanks!
    Sanity is a full time job

    Puh das war harter Stoff!

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Aye, theres a problem with my tiler too, when i tried to extrapolate it to work for all size tiles, then something screwed up, it works only for 32*32 -> 64*32 tiles.
    Hehe, paul look it up for me too
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Another thing

    BTW, if you find something about smooth slopes, like you have in the elevations in Settlers2 or 3, i would be interested in that too
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  10. #10
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    How many points of perspective?

    and how many dimensions is the object? From the fact that it is a tile game I assume 2-D tiles and 1 or 2 points of perspective?

    Regards
    Paul Lewis

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm not sure how to interpret your qwestion so i'll tell you instead what i'm doing (yeah, and Misantrop needs it too)
    Each tiles can be elevated one step, that means we have two digit tiles, one level of slope. There are 4 corners so we need 2^4 = 16 different slopes for each tile, here's an example:
    http://www.geocities.com/kedasu/isotiler.jpg
    Then when the horizontal corners are in a different elevation, the stretch will be done by left and right part independently, creating a line in the middle
    And when the vertical corners are in a different elevation, the top and bottom are stretched independently.
    WEll that's the kind of elevation you have in TRansport tycoon or Tiberian Sun, In settlers you will have 4 levels of elevations and the last and first one starts a slope up or down. That means 2*3^4 = 162 types of slope (yeah they are hexagonal so you have two types of triangles)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  12. #12

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181

    Hey Paul

    Hm sorry, but I really got some Problems with understanding your question. In general I want the same thing like kedaman.
    Except I want something more. On a normal Slope-tile in ISO I also want the hmmm Triangle that is also visible if there is nothing in front of it. When I'm home again, I'll send you an email with a handdrawn Paintbrush graphic, that will show to you what I mean.
    Let us say every tile is cut of a 3D cube. So if you see the slopething you should also see two side, that were already on the cube.

    Hope you understood this
    CU
    Sanity is a full time job

    Puh das war harter Stoff!

  13. #13
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    Errr...

    Yeah, guys I think I was looking at it rather more methematically and not so functionally. What I mean is, I was thinking of how to draw an object on paper in perspective. You guys are far more switched into the application of the drawn tiles into a game. You both know far more about it than I probably ever will.

    I think my question should be ignored because I was definitely thinking in terms of a 3D model being projected onto a plane with 1, 2 or 3 vanishing points.

    From the example you gave kedaman, I now understand the term ISO (isometric right?) and in the context of the topic, I don't know if perspective is the right term for the technique used to generate the tiles. What you are actually doing it seems to me is translating one of the corners by a preset elevation (plus and minus). The same effect can be generated using 2 vanishing points and a perspective projection but I admit I have not done this personally in an application. I have a very good book here that might help so I can send some sample code soon if you like.

    I fear though, that it will not help a great deal...

    Regards
    Paul Lewis

  14. #14

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Would be nice if you'd give it a try!

    I have really some troubles doing this stuff!
    Man where dou you have all those books from!!!

    Thanks
    Sanity is a full time job

    Puh das war harter Stoff!

  15. #15
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Yeah, look it up and see if you find something!
    WEll it wasn't my word either, that perspective, but isometric is kind of a perspective. But that's not the point, the point is to generate the smooth elevation,like calculated by a generic formula or something.
    Thanks
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  16. #16
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I saw this somewhere:

    x_screen = x_obj / z_obj
    y_screen = y_obj / z_obj

    where the object coordinates have already been transformed into eye coordinates.

    [Edited by parksie on 10-16-2000 at 07:00 PM]
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  17. #17
    Member
    Join Date
    Aug 2000
    Location
    USA
    Posts
    32

    Lightbulb "Perspective" is incredibly vague

    There are way too many perspectives to just say "perspective" in a question like that! Some examples:


    -Tile, z ignored (2D)
    Examples: Mario Brothers
    Code:
    screenx = x
    screeny = y
    -Isometric 3/4 view.
    Examples: X-COM, Sim City 2000
    Code:
    screenx = (x - y) * half_of_width
    screeny = (x + y) * half_of_height_minus_one - z * zheight
    -Isometric slanted z view
    Examples: X-COM bases, Battle Tech: The Crescent Hawks' Inception / The Crescent Hawks' Revenge (ancient games, both!)
    Code:
    screenx = x - z
    screeny = y - z
    -Isometric z vertical
    Examples: Early Final Fantasy games, EMail XCOM
    Code:
    screenx = x
    screeny = y - z
    -3D perspective view
    Code:
    'Assuming about 90 degree FOV
    'Note that y * halfofviewwidth is *not* a typo
    screenx = (x * halfofviewwidth) / z + halfofviewwidth
    screeny = (y * halfofviewwidth) / z + halfofviewheight
    There are way more, but ...
    -Koralt

  18. #18
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I thought Early Final Fantasy versions were top-down
    I'm looking for Settler2/3 slopes you know, they are curved with a math formula like Bezier or something.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  19. #19
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    I'm trying

    I'm trying to do up a test app to allow you to easily
    experiment with transformation code on wireframe grids.
    I'll be happy when I can get the simple spherical elevation
    model up and running. then I might actually try and make
    the elevation look realistic..

    I would probably go for a stretched sine wave (or cosine
    depends on the direction). But if there is already an
    agreed standard to get "realistic" looking slopes then let
    me know.

    Cheers
    Paul Lewis

  20. #20

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Paul! You are so far beyond me! I was thinking a just a little bit perspective, and you do realistic slopes! If you get it really to work. I mean it connects to other tiles, ti would be just great!!
    I was looking for a possibility to make something that gives me tiles like used in Sim city 2000 or Transport or Rollercoaster Tycoon.

    Thanks
    Sanity is a full time job

    Puh das war harter Stoff!

  21. #21
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    hehe

    Wait till you see the sample I sent you. You won't be
    thinking I'm advanced after that. I am struggling to
    understand how the tiles will match up. At present, my
    sample doesn't care about the edges matching up because I
    only give you a wireframe view of a single matrix of points
    (connected by lines). It should give you an idea I hope of
    how to (or not to) render the tiles in order to give the 3-
    D effect.


    Oh, and my sample is not in isometric view either - it's
    merely a square shape

    I'll wait to see how you get on.

    Regards
    Paul Lewis

  22. #22

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Hehe I already saw your mail!!! That's why I wrote that you are ahead of me!!!!!

    Cu

    Sanity is a full time job

    Puh das war harter Stoff!

  23. #23
    Hyperactive Member VBD's Avatar
    Join Date
    Apr 2001
    Location
    The Place Above The Place Below Heavin
    Posts
    278

    Wire Frame

    If you want fast simple 3-D, goto the thread CHeap 3-D and download the file

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