Shard Posted July 10, 2010 Share Posted July 10, 2010 This is a fairly complicated question so I hope I present it correctly. I am looking to draw the orbit of planets for my solar system simulation and I'm not sure how to go about it. Last time I tried this (with DarkGDK) I drew several spheres to show the line of the orbit, which then looked correct when viewed from a distance, but was very inefficient. As far as the orbit code goes, I will figure that out using code (which in theory will give me a mathematical function) for what the orbit is. I am hoping I can use this in some way so that I can draw the orbit of the planets using 2D drawing to the screen. Does anyone have any suggestions of how to do this? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Canardia Posted July 10, 2010 Share Posted July 10, 2010 You don't need to use 2D drawing, but you can use 3D lines to connect real vertices with lines: http://leadwerks.com/werkspace/index.php?/page/resources/_/programming/cpp/using-opengl-for-drawing-r19 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Laurens Posted July 10, 2010 Share Posted July 10, 2010 Glancing over the code in that tutorial it may be fairly complicated although it has a far wider use. A perhaps somewhat easier solution would be to simply render a plane with a transparent texture that has an opaque circle on it and then scaling the plane to represent the correct orbit. Quote Link to comment Share on other sites More sharing options...
Shard Posted July 11, 2010 Author Share Posted July 11, 2010 Glancing over the code in that tutorial it may be fairly complicated although it has a far wider use. A perhaps somewhat easier solution would be to simply render a plane with a transparent texture that has an opaque circle on it and then scaling the plane to represent the correct orbit. This doesn't quite work. Because the orbits are based off of the gravitational pulls from the planets around it and the user will have the ability to move planets around, the orbit could be a perfect circle, an oval or not a shape at all and instead just a line. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Volker Posted July 11, 2010 Share Posted July 11, 2010 Shouldn't 3D lines be part of the engine? Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
franck22000 Posted July 11, 2010 Share Posted July 11, 2010 that would be good yes Quote You guys are going to be the death of me. Josh Link to comment Share on other sites More sharing options...
Shard Posted July 12, 2010 Author Share Posted July 12, 2010 You don't need to use 2D drawing, but you can use 3D lines to connect real vertices with lines: http://leadwerks.com/werkspace/index.php?/page/resources/_/programming/cpp/using-opengl-for-drawing-r19 Just glancing at it, this seems a little bit complicated. But alas, I do need it so I'll have to put some time into learning how to do it. I suppose I'll just make a wrapper of sorts and tie it in with my sim initialization/drawing methods. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.