0

I need to create a fairly simply 3D space ship object which would really be comprised of about 3 dozen vectors (maybe a dozen planes). I have no need for surface rendering or lighting, simply plane-edge vectors. Once I have the 3D vector model of it, I need to put it into an initial position, then rotate on 2 axis' incrementally to create a set of 2D projections of the sequence from initial view to final view.

I really don't know where to start on this. I have skills from OpenSCAD to C# and Javascript. I have Photoshop, Illustrator... I have never coded in OpenGL or Unity but it certainly seems like Unity might be right up my alley but Im not sure how to create the 3D object to import into Unity... in the end I need 2D vectors of the projection sequence as I will render them myself. Hidden surface removal would be nice but I can also manually fix those in end by truncating/removing individual vectors.

Im literally working in 1983 and coding on a 6502 but I can do the projections on a PC luckily.

I also feel like Unity might be overkill?

Any directional tips for me? thank you!

jaskey
  • 226
  • 2
  • 9
  • Well not for nothing, but I actually did this in OpenSCAD in about 4 hours... obviously that is only half the battle, but at least I have my 3D points to describe the object/ship. I may investigate either writing something up in C# to rotate it and create projections rather than jumping into Unity, although, Unity may be able to 'import' my 3d file. Downside of my OpenSCAD object, is that I highly doubt it is manifold for converting into a 'real' 3D object suitable for import. – jaskey Jul 29 '20 at 04:47
  • Could you elaborate on what you mean by vectors? Because 3D models, at least those used in games, aren't made of vectors... but rather vertices and triangles. The only vectors are the normals, which you said you don't need (they're for lighting). And you don't create models in Unity, you use them. It's a game engine, not a modeling program. For that, you need Blender or 3Ds Max (or Maya). As for rotations, they're dead simple to create with Unity's GUI, and you can record them to make animations. (You can do the same in modeling software.) You can code them, too, but it's more complicated. – verified_tinker Jul 29 '20 at 06:16
  • Yeah, it is hard to translate as Im trying to go backwards and create 2D vector renderings for an old 'Vector' (XY based) video game. I will render the output 2D sets of vectors using the old tech, but I need to actually create all those 2D vector sets with current technology. For the original game, they did it on a VAX, but Im not trying to duplicate that obviously. A cube is probably the best example for this forum, but it extrapolates to my object... I need to get the 8 points for the cube corners and the 12 vectors resulting. and then I need those 12 vectors in the sequential projections. – jaskey Jul 29 '20 at 15:23
  • here is my object - https://photos.app.goo.gl/gPb7ca7MVYnxLEHp9 I do ironically now have all my 3D points defined in OpenSCAD because I used polyhedron objects for everything. I think my process will now be to somehow make this manifold and attempt to import this into a real 3D program to get a holistic object, then I can import into Unity and output my 'wireframe' projections into 2D coordinate vectors? – jaskey Jul 29 '20 at 15:42
  • Okay, I used FreeCAD to convert my.stl into an 3D .obj file (after some manifold fixes)... I was able to import the .obj into Unity (see new photo in Google Album linked above)... I guess I better start reading documents as Im completely at a loss on what to do in Unity to try and get this output as just points (vertices of the triangles).. so the wireframe? and then how to make a scene to rotate the object and get a 2D (flat) perspective collection of points of the object. It may be easier for me to just try to make a winforms project in C# and do the transormations and projections tho? – jaskey Jul 30 '20 at 00:01
  • So let me get this straight: you need to project a modern 3D model onto a 2D plane, then take the edges and convert them into vectors to input into an old engine that uses vectors to render its... 3D objects? 2D images? – verified_tinker Jul 30 '20 at 11:49
  • Yes, well said and thank you! The learning curve on Unity to do this might be too steep for me... so right now Im just writing up a quick C# program to 1) Import a .3mf file (which I can export from OpenSCAD, it contains the vertices and triangles for the entire object) 2) View It from any arbitrary angle (X,Y,Z sliders) 3) Project the view to 2D and export the 2D vectors. I can get away with using some pretty basic vector math in the System.Drawing namespace to do this. – jaskey Jul 30 '20 at 15:33
  • Compared to what you're doing, learning the fundamentals of Unity should be trivial. You just need to drop the model into a scene and rotate as you wish; that's a large part of the challenge just done for you. Before we can go further, I need you to clarify: when you say vectors, do you just mean 2D coordinates forming a vector with origin (0, 0), or does a vertex on the ship point directly toward another vertex? The first is vastly easier to do than the 2nd. – verified_tinker Jul 30 '20 at 17:48
  • Yes, I believe the first case if I understand correctly. Outputs will be 2D X,Y coordinates with a 0,0 origin.I imported my ship into Unity from the .obj and it renders in the designer UI (I have my asset sitting in a scene) but Im not entirely sure what direction to go from here. When I import the asset, it tilts it on its side however, so not sure how to true it back vertical which is my reference position. – jaskey Jul 31 '20 at 05:08
  • OK. Can you put up a link for your model? And does your CAD software let you export as FBX? – verified_tinker Jul 31 '20 at 05:13
  • yessir... here is my .obj model - http://www.askey.org/mhavocpex/catastrofighter_v1.zip FreeCAD does not seem to support exporting to .fbx however (as far as I could find). That zip contains the .obj, .stl and .3mf. The .obj imports into Unity fine and looks good. The .3mf is what Im using to try and import into my homebuilt C# app to try and rotate/project the object, but Im a bit away from having that functional. I probably need to read up on Unity C# as Im super comfortable in C#, just not Unity (yet?). thank you! – jaskey Jul 31 '20 at 16:08
  • I think I have Unity in a good place with my .obj... I have a Single Scene, with my Asset sitting on it... I have configured the Unity Project to build and output a Visual Studio Solution and I am able to run the Project now directly from Visual Studio where I am the most comfortable. When I run right now, I just get an empty horizon still so I don't quite understand how to either load a scene or place an asset yet. Looking at docs still... – jaskey Jul 31 '20 at 18:58
  • and.... I just realized all the VS solution code is .cpp so that isn't really a place I will be I guess. Looks like I will be in the Startup() and Update() methods directly in Unity I think? Still getting my bearings in here. :-) – jaskey Jul 31 '20 at 19:05
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/219007/discussion-between-verified-tinker-and-jaskey). – verified_tinker Jul 31 '20 at 19:34
  • Okay, one final note for a bit... I have my object showing in camera view when I compile the game now, so I got all that figured out... I changed the ground to be on the Z-axis so im in the correct perspective. Need to start reading up on Unity documentation now on how to write 'script' (which is code) for manipulating the object (rotating by x degrees on the Z axis for now) and then figuring out how to get data out from this (can I dump data from 'script' into files using System.IO namespace just like normal .NET?). - https://photos.app.goo.gl/aLPVMtXankssyfvJ9 – jaskey Jul 31 '20 at 21:36

0 Answers0