Board index » delphi » 3D programming

3D programming

I've been trying my best to write a 3d engine recently for a role playing
game I'm programming, but so far, have been unsuccessful.  I'm currently at
the stage of attempting to translate x,y,z world co-ordinates to x,y screen
co-ordinates.  It almost works, but not quite.  It works perfectly in
certain circumstances, and not at all in others.  I have two functions,
"getx" and "gety" defined as follows: (originally in Pascal, I'll attempt
to translate to C)

struct point_type
{
        long x,y,z; // world co-ordinates

Quote
}

struct camera_type
{
        long x,y,z; // world co-ordinates
        float a,b; //a : pitch (left/right) b: yaw (up/down)

Quote
}

int getx(camera_type camera, point_type point)
int gety(camera_type camera, point_type point)

I hope I didn't make any mistakes translating.  I'm not rotating or moving
my points, I'm moving the camera instead.  I've seen plenty of info on how
to rotate the points around the camera, but I'm not going to do that
because of some problems it would cause with the rest of my game.  If
anyone could help me in any way with this dilemma, it would be greatly
appreciated.

                                                                Derek Lewis
                                                                Xenocide

 

Re:3D programming


Quote
Derek Lewis wrote in message <01bdb83f$c42d5e80$7121fea9@xenocide>...
>I've been trying my best to write a 3d engine recently for a role playing
>game I'm programming, but so far, have been unsuccessful

In case you're interested, I've got some 2D/3D vector graphics code in TP 7
on the Graphics page of my Computer Lab (most of the examples there are in
Delphi, however.)  Look at the bottom of the page for the "Turbo Pascal 7
Version of SphereInBox".

efg

Re:3D programming


Derek Lewis ha scritto nel messaggio
<01bdb83f$c42d5e80$7121fea9@xenocide>...

Quote
>I've been trying my best to write a 3d engine recently for a role playing
>game I'm programming, but so far, have been unsuccessful.  I'm currently at
>the stage of attempting to translate x,y,z world co-ordinates to x,y screen
>co-ordinates.  It almost works, but not quite.  It works perfectly in
>certain circumstances, and not at all in others.  I have two functions,
>"getx" and "gety" defined as follows: (originally in Pascal, I'll attempt
>to translate to C)

I'm very intersted in you r work If you can send me a part of your
documentation or tell me where have you find your information.
Thank !

Other Threads