# 3d Visualisation (3d to 2d)

This topic is 4816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey, I want to calculate the 2d location in let's say a graph, from 3d coordinates. I'm new to this subject and I have no idea how to do it. I found a few tutorials, but when they started talking about matrixes I get confused :S. I do ahve experience with OpenGL, but yea, I want to make some non-realtime render engine for fun :). Not sure if I can call it engine, my first objective is drawing a few pixels... then a line, then a cube, then triangles. Thanks, - Myth

##### Share on other sites
Say you want 2d coordinates on a x-y plane, and your 3d coordinates are (x, y, z). It's actually as simple as z=0. (x, y) are your 2d coordinates! To teach you a fancy term, this is called the projection of a vector on a plane. [smile]

##### Share on other sites
z = 0*(x, y)?
I don't quite get it..
If you have x,y,z respectivicly {10,10,10}
You'd have: 10 = 0*(10,10) ...?
There won't be much left to solve + it won't equel 10, erm..
I don't mean your equetion is incorrect, it proberly is good, I just don't get it.
I lost my train of though :P

##### Share on other sites
It sounds like you want to write your own graphics pipeline.

First it helps to understand how what you're doing in openGL works. In OpenGL you're working with matrices all the time, you just might not realize it since there are functions that do everything you need with them. glTranslate, glRotate, and glScale actually build matrices that represent translation, rotation, and scaling and then multiply the current matrix by them.

They use a 4 by 4 matrix because such a matrix can represent all the geometric transformations you usually need to move geometry around in 3d space. Multiplying a vertex by a matrix results in transforming the vertex by the matrix. If your vertex is [x y z 1] then multiplying it by a matrix that represents a translation on the x axis up 5 units will result in the vertex [x+5 y z 1]. So all this matrix stuff is really fundamental to how the geometry of your objects is interpreted. OpenGL takes your vertices and multiplies them by the current matrix, which was formed by multiplying all the matrices for your transformations together (it does this as you tell it each transformation).

The way it usually works is all these transformations end up placing the geometry so that things that are straight ahead of the camera are on the positive z axis. Then to get perspective, the place a vertex is drawn on the screen is (x/z),(y/z) (assuming the center of the screen is (0,0), if it's not you just do a little more math to line things up). This is because what you see through a window is not everything in a rectangular box in front of you, but rather everything in a trapezoidal shaped box. For the clip planes, you don't want to see any geometry behind the camera, so any geometry with a value less than some small z value is not drawn. Usually graphics systems have a far clip plane too.

The camera matrix does some math with the z coordinate before the object is drawn to the screen which sets up this division to result in the appropriate projection. If you look at the matrices created by the openGL functions that create the camera matrix you can see what they do.

Getting vertices to the screen is the first thing. After you know where to draw vertices on the screen, you can draw lines on the screen connecting them, and you can fill in triangles. Then there is the problem of depth ordering, so that's where z buffering comes in. The older 3d games before hardware acceleration had to use more clever methods for drawing the geometry from back to front to ensure that objects further away are obscured by closer objects. I think they used things like quadtrees and bsp trees to do this. And that's a whole different issue...

Also there is backface clipping, where you don't draw triangles that are facing away from the camera. For drawing a convex polyhedron, like a cube, that's enough to ensure that things further away aren't drawn closer than things near the camera.

##### Share on other sites
No, no, that '.' was just a full stop! (x, y) are your coordinates! Talk about knowing more math than you should ... which is ofcourse a good thing ;)

##### Share on other sites
Thanks, I indeed want to write my own graphics pipeline.
I still don't understand what matrices actually do.
They contain values for a formula?

EDIT: Lol didn't look at it that way.

##### Share on other sites
For some reason my draw3dline function isn't working.
The getTargetAngle, GetDist, and Put3dPixel functions do work.
Someone helped me making this for another thing once I based it on it.
But I don't quite remember what everything excatly does.
The problem is proberly, does:
(facing * (1.0f + 1.0f)) + _p1 ?= (_p1.x+facing.x*2,_p1.y+facing.y*2,_p1.z+facing.z*2).I'm not sure if it's correct.void _ART::draw3dline(vector3df p1, vector3df p2){ Put3DPixel(p1.x,p1.y,p1.z); Put3DPixel(p2.x,p2.y,p2.z); vector3df _p1 = vector3df(p1); int count = (int)Math->GetDist(p1,p2); for(int i=0;i<count;i++) { // What direction do we have to 'move' to go to the other point? // Returns rotation. vector3df rot = Math->getTargetAngle(p1,p2); // So we must face that way... vector3df facing = vector3df( sin( (rot.y+90) * PI/180.0f), 0, cos( (rot.y+90) * PI/180.0f) ); // Eventualy, we move the way we are facing. // We move pixel per pixel :) // This is: (facing * (1.0f + 1.0f)) + _p1; // But for some reason that isn't allowed. _p1 = vector3df(_p1.x+facing.x*2,_p1.y+facing.y*2,_p1.z+facing.z*2); Put3DPixel(_p1.x,_p1.y,_p1.z); }} 
 0 
 Share this post Link to post Share on other sites 
 
 
 Zakwayda    2166 Zakwayda Member 2166 Posted September 11, 2005 Quote:Thanks, I indeed want to write my own graphics pipeline.I still don't understand what matrices actually do.They contain values for a formula?You could conceivably write a software pipeline without matrices, but I doubt you'd want to. It's possible you might be better off backing up a little and getting comfortable with matrix and vector math before tackling such a project.Matrices are a convenient way to express and combine linear transformations. Let's say you have a vector (x,y), and you want to transform it as follows:x' = ax+byy' = cx+dyThis can be written in matrix form as:[a b][x][c d][y]Or:[x y][a c] [b d]Most of the operations we want to perform in a graphics pipeline involve mapping a vector from one coordinate system to another (e.g. geometric transformations), or a vector component from one range of values to another (e.g. projection). Such operations can be concisely and conveniently expressed using matrices.I'd think the bare minimum you'd need to know to get started would be:1. How to multiply a matrix and a matrix2. How to multiply a matrix and a vector (a special case of the above)3. The difference between row and column vectors[Edited by - jyk on September 11, 2005 3:04:00 PM] 0 Share this post Link to post Share on other sites Guest Anonymous Poster    Guest Anonymous Poster Guests Posted September 11, 2005 The easiest way to draw a 3d line defined by its end points to a 2d display is to determine the coordinates of the endpoints on the 2d display and then draw a 2d line between those coordinates. 0 Share this post Link to post Share on other sites Myth000    128 Myth000 Member 128 Posted September 12, 2005 But how to calculate all pixels on a line?EDIT: nvm http://www.gamedev.net/reference/articles/article1275.asp 0 Share this post Link to post Share on other sites 
 Sign in to follow this   Followers 0 
 Go To Topic Listing Math and Physics Advertisement 
 Advertisement Popular Tags 2D 3D Advice Algorithm Animation C# C++ Character Concept Design DX11 Education GameMaker Gameplay General Java Learning Marketing Mobile Music OpenGL PC Unity Unreal VR Popular Contributors Week Month Year All Time 1 Rutin 43 2 CyberFlash 24 3 Septopus 24 4 Gnollrunner 11 5 supermikhail 11 Show More Advertisement Popular Now 9 number of matching chars in 2 strings By ICanCStarted Yesterday at 11:20 AM 27 collision sprite By phil67rpgStarted Friday at 10:13 PM 20 Pub/Sub for game Servers... Are you? By SeptopusStarted Thursday at 06:38 PM 9 C++ Dynamic memory using "new" and malloc() By rytStarted Thursday at 01:59 PM 20 Can I use assets from another game under these conditions? By JaretStarted November 13 Forum Statistics Total Topics 633398 Total Posts 3011659 Who's Online (See full list) There are no registered users currently online GameDev.net GameDev.net Articles GameDev.net Event Coverage GameDev.net Forums GameDev.net Blogs GameDev.net Gallery GameDev.net News GameDev.net Projects GDNet Chat All Activity Search In Everywhere This Forum This Topic More options... Find results that contain... All of my search term words Any of my search term words Find results in... Content titles and body Content titles only Home Forums Programming Math and Physics 3d Visualisation (3d to 2d) 
 
 
 × Existing user? Sign In Sign Up Browse Back Articles & Tutorials Back All Categories Audio Business Game Design Industry Programming Visual Arts Columns Back GameDev Unboxed Event Coverage Back All Events Game Developers Conference Power Up Digital Games Conference GameDev.Market Links News Podcasts Back All Podcasts Game Dev Loadout Archive Community Back Beginners Back Beginners Group Beginners Forum Beginners Resources Blogs Calendar Chat Forums Back All Forums Audio Business Game Design Programming Visual Arts Community GameDev Challenges Affiliates Topical Workshops Gallery Groups Back For Beginners GameDev Challenges All Groups Projects Back All Projects Games Game Assets Game Mods Developer Tools Store Forums Back All Forums For Beginners Audio Back Music and Sound FX Games Career Development Business Back Games Career Development Production and Management Games Business and Law Game Design Back Game Design and Theory Writing for Games Programming Back Artificial Intelligence Engines and Middleware General and Gameplay Programming Graphics and GPU Programming Math and Physics Networking and Multiplayer Visual Arts Back 2D and 3D Art Critique and Feedback Community Back GameDev Challenges GDNet Lounge GDNet Comments, Suggestions, and Ideas Coding Horrors Your Announcements Hobby Project Classifieds Indie Showcase Affiliates Back NeHe Productions AngelCode Topical Workshops Careers Back Contractors Hobby Projects Game Jobs Back Browse on GameDev.Jobs Post a Job Members Back Subscriptions Chat Guidelines Leaderboard Online Users Awards Search Back All Activity My Activity Streams Back Latest Topics Featured Blogs Search var ipsDebug = false; var CKEDITOR_BASEPATH = '//www.gamedev.net/applications/core/interface/ckeditor/ckeditor/'; var ipsSettings = { cookie_path: "/", cookie_prefix: "ips4_", cookie_ssl: true, upload_imgURL: "", message_imgURL: "", notification_imgURL: "", baseURL: "//www.gamedev.net/", jsURL: "//www.gamedev.net/applications/core/interface/js/js.php", csrfKey: "3778993dea06a32b94c1006179e9981c", antiCache: "14de000c45", disableNotificationSounds: false, useCompiledFiles: true, links_external: true, memberID: 0, analyticsProvider: "ga", viewProfiles: true, mapProvider: 'google', mapApiKey: "AIzaSyAeT7tk3vnWWmbgVISkLpbhkQvekG19rHM", }; ips.setSetting( 'date_format', jQuery.parseJSON('"mm\/dd\/yy"') ); ips.setSetting( 'date_first_day', jQuery.parseJSON('0') ); ips.setSetting( 'remote_image_proxy', jQuery.parseJSON('1') ); ips.setSetting( 'ipb_url_filter_option', jQuery.parseJSON('"none"') ); ips.setSetting( 'url_filter_any_action', jQuery.parseJSON('"allow"') ); ips.setSetting( 'bypass_profanity', jQuery.parseJSON('0') ); ips.setSetting( 'emoji_style', jQuery.parseJSON('"native"') ); ips.setSetting( 'emoji_shortcodes', jQuery.parseJSON('"1"') ); ips.setSetting( 'emoji_ascii', jQuery.parseJSON('"1"') ); ips.setSetting( 'emoji_cache', jQuery.parseJSON('"1"') ); ips.setSetting( 'quickSearchDefault', jQuery.parseJSON('"all"') ); ips.setSetting( 'quickSearchMinimum', jQuery.parseJSON('3') ); ips.setSetting( 'quickSearchShowAdv', jQuery.parseJSON('true') ); ips.setSetting( 'quickSearchIn', jQuery.parseJSON('"title"') ); { "@context": "http://schema.org", "@type": "DiscussionForumPosting", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/", "discussionUrl": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/", "name": "3d Visualisation (3d to 2d)", "headline": "3d Visualisation (3d to 2d)", "text": "Hey,\n\nI want to calculate the 2d location in let\u0027s say a graph, from 3d coordinates.\nI\u0027m new to this subject and I have no idea how to do it.\nI found a few tutorials, but when they started talking about matrixes I get confused :S.\nI do ahve experience with OpenGL, but yea, I want to make some non-realtime render engine for fun :).\nNot sure if I can call it engine, my first objective is drawing a few pixels... then a line, then a cube, then triangles.\n\nThanks,\n- Myth", "dateCreated": "2005-09-11T10:05:57+0000", "datePublished": "2005-09-11T10:05:57+0000", "pageStart": 1, "pageEnd": 1, "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "author": { "@type": "Person", "name": "Myth000", "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "url": "https://www.gamedev.net/profile/86789-myth000/" }, "interactionStatistic": [ { "@type": "InteractionCounter", "interactionType": "http://schema.org/ViewAction", "userInteractionCount": 607 }, { "@type": "InteractionCounter", "interactionType": "http://schema.org/CommentAction", "userInteractionCount": 9 }, { "@type": "InteractionCounter", "interactionType": "http://schema.org/FollowAction", "userInteractionCount": 14 } ], "comment": [ { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=344726", "author": { "@type": "Person", "name": "Myth000", "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "url": "https://www.gamedev.net/profile/86789-myth000/" }, "dateCreated": "2005-09-11T10:05:57+0000", "text": "Hey,\n\nI want to calculate the 2d location in let\u0027s say a graph, from 3d coordinates.\nI\u0027m new to this subject and I have no idea how to do it.\nI found a few tutorials, but when they started talking about matrixes I get confused :S.\nI do ahve experience with OpenGL, but yea, I want to make some non-realtime render engine for fun :).\nNot sure if I can call it engine, my first objective is drawing a few pixels... then a line, then a cube, then triangles.\n\nThanks,\n- Myth", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252600", "author": { "@type": "Person", "name": "deavik", "image": "https://secure.gravatar.com/avatar/444abeeb8c6ece8e0b3d60dd6cc9df96?d=https://www.gamedev.net/uploads/monthly_2017_08/D.png.c0a3bec96689c12820b3009830fc1158.png", "url": "https://www.gamedev.net/profile/83562-deavik/" }, "dateCreated": "2005-09-11T11:01:48+0000", "text": "Say you want 2d coordinates on a x-y plane, and your 3d coordinates are (x, y, z). It\u0027s actually as simple as z=0. (x, y) are your 2d coordinates! To teach you a fancy term, this is called the projection of a vector on a plane. [smile]", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252612", "author": { "@type": "Person", "name": "Myth000", "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "url": "https://www.gamedev.net/profile/86789-myth000/" }, "dateCreated": "2005-09-11T11:14:05+0000", "text": "z = 0*(x, y)?I don\u0027t quite get it..If you have x,y,z respectivicly {10,10,10}You\u0027d have: 10 = 0*(10,10) ...?There won\u0027t be much left to solve + it won\u0027t equel 10, erm..I don\u0027t mean your equetion is incorrect, it proberly is good, I just don\u0027t get it.I lost my train of though :P", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252658", "author": { "@type": "Person", "name": "Anonymous Poster", "image": "https://www.gamedev.net/uploads/set_resources_7/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png" }, "dateCreated": "2005-09-11T11:35:38+0000", "text": "It sounds like you want to write your own graphics pipeline.First it helps to understand how what you\u0027re doing in openGL works. In OpenGL you\u0027re working with matrices all the time, you just might not realize it since there are functions that do everything you need with them. glTranslate, glRotate, and glScale actually build matrices that represent translation, rotation, and scaling and then multiply the current matrix by them.They use a 4 by 4 matrix because such a matrix can represent all the geometric transformations you usually need to move geometry around in 3d space. Multiplying a vertex by a matrix results in transforming the vertex by the matrix. If your vertex is [x y z 1] then multiplying it by a matrix that represents a translation on the x axis up 5 units will result in the vertex [x+5 y z 1]. So all this matrix stuff is really fundamental to how the geometry of your objects is interpreted. OpenGL takes your vertices and multiplies them by the current matrix, which was formed by multiplying all the matrices for your transformations together (it does this as you tell it each transformation).The way it usually works is all these transformations end up placing the geometry so that things that are straight ahead of the camera are on the positive z axis. Then to get perspective, the place a vertex is drawn on the screen is (x/z),(y/z) (assuming the center of the screen is (0,0), if it\u0027s not you just do a little more math to line things up). This is because what you see through a window is not everything in a rectangular box in front of you, but rather everything in a trapezoidal shaped box. For the clip planes, you don\u0027t want to see any geometry behind the camera, so any geometry with a value less than some small z value is not drawn. Usually graphics systems have a far clip plane too.The camera matrix does some math with the z coordinate before the object is drawn to the screen which sets up this division to result in the appropriate projection. If you look at the matrices created by the openGL functions that create the camera matrix you can see what they do.Getting vertices to the screen is the first thing. After you know where to draw vertices on the screen, you can draw lines on the screen connecting them, and you can fill in triangles. Then there is the problem of depth ordering, so that\u0027s where z buffering comes in. The older 3d games before hardware acceleration had to use more clever methods for drawing the geometry from back to front to ensure that objects further away are obscured by closer objects. I think they used things like quadtrees and bsp trees to do this. And that\u0027s a whole different issue...Also there is backface clipping, where you don\u0027t draw triangles that are facing away from the camera. For drawing a convex polyhedron, like a cube, that\u0027s enough to ensure that things further away aren\u0027t drawn closer than things near the camera.", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252700", "author": { "@type": "Person", "name": "deavik", "image": "https://secure.gravatar.com/avatar/444abeeb8c6ece8e0b3d60dd6cc9df96?d=https://www.gamedev.net/uploads/monthly_2017_08/D.png.c0a3bec96689c12820b3009830fc1158.png", "url": "https://www.gamedev.net/profile/83562-deavik/" }, "dateCreated": "2005-09-11T12:01:05+0000", "text": "No, no, that \u0027.\u0027 was just a full stop! (x, y) are your coordinates! Talk about knowing more math than you should ... which is ofcourse a good thing ;)", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252746", "author": { "@type": "Person", "name": "Myth000", "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "url": "https://www.gamedev.net/profile/86789-myth000/" }, "dateCreated": "2005-09-11T12:33:37+0000", "text": "Thanks, I indeed want to write my own graphics pipeline.I still don\u0027t understand what matrices actually do.They contain values for a formula?EDIT: Lol didn\u0027t look at it that way.", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252763", "author": { "@type": "Person", "name": "Myth000", "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "url": "https://www.gamedev.net/profile/86789-myth000/" }, "dateCreated": "2005-09-11T12:43:55+0000", "text": "For some reason my draw3dline function isn\u0027t working.The getTargetAngle, GetDist, and Put3dPixel functions do work.Someone helped me making this for another thing once I based it on it.But I don\u0027t quite remember what everything excatly does.The problem is proberly, does:(facing * (1.0f + 1.0f)) + _p1 ?= (_p1.x+facing.x*2,_p1.y+facing.y*2,_p1.z+facing.z*2).I\u0027m not sure if it\u0027s correct.void _ART::draw3dline(vector3df p1, vector3df p2){ Put3DPixel(p1.x,p1.y,p1.z); Put3DPixel(p2.x,p2.y,p2.z); vector3df _p1 = vector3df(p1);int count = (int)Math-\u0026gt;GetDist(p1,p2);for(int i=0;i\u0026lt;count;i++) {// What direction do we have to \u0027move\u0027 to go to the other point?// Returns rotation. vector3df rot = Math-\u0026gt;getTargetAngle(p1,p2);// So we must face that way... vector3df facing = vector3df( sin( (rot.y+90) * PI/180.0f),0, cos( (rot.y+90) * PI/180.0f) );// Eventualy, we move the way we are facing.// We move pixel per pixel :)// This is: (facing * (1.0f + 1.0f)) + _p1;// But for some reason that isn\u0027t allowed. _p1 = vector3df(_p1.x+facing.x*2,_p1.y+facing.y*2,_p1.z+facing.z*2); Put3DPixel(_p1.x,_p1.y,_p1.z); }}", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252793", "author": { "@type": "Person", "name": "jyk", "image": "https://www.gamedev.net/uploads/monthly_2018_07/Z_member_51412.png", "url": "https://www.gamedev.net/profile/51412-zakwayda/" }, "dateCreated": "2005-09-11T13:04:50+0000", "text": "You could conceivably write a software pipeline without matrices, but I doubt you\u0027d want to. It\u0027s possible you might be better off backing up a little and getting comfortable with matrix and vector math before tackling such a project.Matrices are a convenient way to express and combine linear transformations. Let\u0027s say you have a vector (x,y), and you want to transform it as follows:x\u0027 = ax+byy\u0027 = cx+dyThis can be written in matrix form as:[a b][x][c d][y]Or:[x y][a c] [b d]Most of the operations we want to perform in a graphics pipeline involve mapping a vector from one coordinate system to another (e.g. geometric transformations), or a vector component from one range of values to another (e.g. projection). Such operations can be concisely and conveniently expressed using matrices.I\u0027d think the bare minimum you\u0027d need to know to get started would be:1. How to multiply a matrix and a matrix2. How to multiply a matrix and a vector (a special case of the above)3. The difference between row and column vectors[Edited by - jyk on September 11, 2005 3:04:00 PM]\n", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3252812", "author": { "@type": "Person", "name": "Anonymous Poster", "image": "https://www.gamedev.net/uploads/set_resources_7/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png" }, "dateCreated": "2005-09-11T13:15:54+0000", "text": "The easiest way to draw a 3d line defined by its end points to a 2d display is to determine the coordinates of the endpoints on the 2d display and then draw a 2d line between those coordinates.", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/?do=findComment\u0026comment=3254103", "author": { "@type": "Person", "name": "Myth000", "image": "https://secure.gravatar.com/avatar/a1073cca2f2060d5b3eb1338db876a69?d=https://www.gamedev.net/uploads/monthly_2017_08/M.png.10e11f9b821296cf7a03b8ac6a78df99.png", "url": "https://www.gamedev.net/profile/86789-myth000/" }, "dateCreated": "2005-09-12T12:02:19+0000", "text": "But how to calculate all pixels on a line?EDIT: nvm http://www.gamedev.net/reference/articles/article1275.asp", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/344726-3d-visualisation-3d-to-2d/" } ] } { "@context": "http://www.schema.org", "@type": "WebSite", "name": "GameDev.net", "url": "https://www.gamedev.net/", "potentialAction": { "type": "SearchAction", "query-input": "required name=query", "target": "https://www.gamedev.net/search/?q={query}" }, "inLanguage": [ { "@type": "Language", "name": "English (USA)", "alternateName": "en-US" } ] } { "@context": "http://www.schema.org", "@type": "Organization", "name": "GameDev.net", "url": "https://www.gamedev.net/", "address": { "@type": "PostalAddress", "streetAddress": "", "addressLocality": null, "addressRegion": null, "postalCode": null, "addressCountry": null } } { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "item": { "@id": "https://www.gamedev.net/forums/", "name": "Forums" } }, { "@type": "ListItem", "position": 2, "item": { "@id": "https://www.gamedev.net/forums/forum/4-programming/", "name": "Programming" } }, { "@type": "ListItem", "position": 3, "item": { "@id": "https://www.gamedev.net/forums/forum/7-math-and-physics/", "name": "Math and Physics" } } ] } { "@context": "http://schema.org", "@type": "ContactPage", "url": "https://www.gamedev.net/contact/" } Important Information By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.   I accept We are the game development community. Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up! Sign me up!