Thread: Space

  1. #1
    10%GameProgrammer compile
    Join Date
    Jan 2005
    Posts
    10

    Post Space

    Could some one tell me how to create space.

    lets say i wanted to create a map composed of equalateral six sided polygons.

    i guess what im realy asking is how do you create a space manager?

    can any one pass any theories or C++ code

    thanks
    cout<<"hello world"<<endl;

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    Maybe reading the tutorials at


    http://nehe.gamedev.net/default.asp

    would give you some idea what they do create a three dimensional appearance. If you want to draw two dimensional material, that site can help as well, although maybe you will have enough flexibility using WinApi polygon drawing functions to do what you want. I'm not familiar with tutorials for other programs like DirectX or Allegro, etc., but I'm sure they are available.
    You're only born perfect.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You don't create space. You create vertexes in 3D space. Then you draw lines from vertex to vertex to create triangles. Then you fill the triangles, light them, texture them, rotate them, scale them, etc, etc.

    I would suggest getting a book on 3D mathematics.

  4. #4
    10%GameProgrammer compile
    Join Date
    Jan 2005
    Posts
    10
    i dont want to get into graphics i just want to know the best way to create a space. doesnt have to be seen. i just want to measure the distance between two points. and each space to conect to three spaces in front and three spaces in the back.

    throries and code on doing this would be nice

    PS: if any one thinks im trying to put to much information into a text rpg tell me!
    cout<<"hello world"<<endl;

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    You aren't making a whole lot of sense to be blatantly honest. To find the distance between two points in 3D space:

    distance = square_root( (PointA - PointB)^2 )

    PointA - PointB is really another vector, just centered at the origin. Call it vector C. The equation then looks like:

    distance = square_root( C.x*C.x + C.y*C.y + C.z*C.z )

    where C.x is the x coordinate of the vector, etc

    note that this:
    C.x*C.x + C.y*C.y + C.z*C.z

    is the same as taking the dotproduct of C with itself so the equation can also be:

    distance = square_root( A DOT A )
    See you in 13

  6. #6
    10%GameProgrammer compile
    Join Date
    Jan 2005
    Posts
    10
    well i know the formula i guess im making a blundering fool of my self =D

    im trying to implement the rules of GURPS into a text based game.

    when your character is in combat it uses a six sided polygon map conected at the sides. if you can imagine it.

    each polygon is one yard long and one yard wide and one yard across. so when the player is in one hex he can be attack at the front by three people and the back by three people.

    but i could do this in a free space enviroment. but again im in the zone of mapping the area's

    should i stick with text base or should i pick up graphics and do it that way.

    im so confused.
    cout<<"hello world"<<endl;

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    What you need then is an array with each element representing one hex on the grid. Or you can use another storage method more suited towards hex grids.

    But I agree with Darkness you are not making a lot of sense. Space is extremely vague.
    Last edited by VirtualAce; 01-04-2005 at 08:08 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Out of space when compiling kernel
    By NuNn in forum Linux Programming
    Replies: 3
    Last Post: 04-01-2009, 02:43 PM
  2. disk space mysteriously gone
    By evader in forum C++ Programming
    Replies: 4
    Last Post: 01-21-2004, 01:30 PM
  3. Replies: 12
    Last Post: 05-17-2003, 05:58 AM
  4. someone who is good at finding and fixing bugs?
    By elfjuice in forum C++ Programming
    Replies: 8
    Last Post: 06-07-2002, 03:59 PM