Programming Question Mother of a Freighter

wingaviator

New member
Joined
Sep 23, 2012
Messages
8
Reaction score
0
Points
0
I ran into a roadblock with a ship I designed in Sketchup (I know not the ideal designer). I was able to get the model in Orbiter, but the flickering factor told me something was wrong right away. I had initially hoped to reach out to the community for the programming end for someone who might be interested in a co-creator credit kind of thing, but put the project to the side completely when even loading into Orbiter was showing issues. This may just be to its sheer size.

There's many componets added to this ship, and I love the way she looks, however I would need help at this point to get a working model. Rather than shelf the model any longer I thought I would reach out and see if anyone is interested. Seems like such a waste of work if I dont.

Within Sketchup, there are animations for almost all of the surfaces. Hanger atop, radar, high gain antannae, turrets, wing position, sheilds for viewing center, cargo bay doors, ramps, gear, hover thrusters, turrets at the bottom, front facing rail guns. The thing is massive.

Attaching a screenshot here. I can also provide a zip of the Sketchup file. Thank you in advance for taking a look.
 

Attachments

  • Freighter1.JPG
    Freighter1.JPG
    71.1 KB · Views: 52
  • Freighter2.JPG
    Freighter2.JPG
    84.9 KB · Views: 40
  • Freighter3.JPG
    Freighter3.JPG
    84.6 KB · Views: 38
  • Freighter4.JPG
    Freighter4.JPG
    142 KB · Views: 39

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,873
Reaction score
2,129
Points
203
Location
between the planets
Can you describe the problems you're having more closely? Just "flickering" doesn't really say anything useful to guess at the problem.
 

wingaviator

New member
Joined
Sep 23, 2012
Messages
8
Reaction score
0
Points
0
Should of originally said at this point I'm not really looking to fix the ship myself. Rather didn't want the ship to go to waste. Would love to see it in Orbiter, but looking for someone who is also interested who would like to take over trying to make this mammoth defy gravity. If no one is interested, that is fine too.

My knowledge of the coding process, figuring out where all the coordinates are, animations, etc are non-existent and I just dont have the time. Perhaps someone out there has the skills to make it an easy task.

Regarding the flickering though all I know is what happened when I put it into Orbiter. The faces of the ship model flickered white then dark while the surrounding structures, such as that at KSC remained constant and normal.

Part of me even thought that it might just be due to sheer size messing with the games shadowing effects. At present length is roughly 1,000' with a width about a third.
 

Loru

Retired Staff Member
Retired Staff
Addon Developer
Donator
Joined
Sep 30, 2008
Messages
3,731
Reaction score
6
Points
36
Location
Warsaw
If you tried to import make orbiter .cfg type vessel make sure you're at least 0.01 meter above the ground or try spwaning it in space. If flicker remains in space it's probably double sided faces (polygons) of the mesh.
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,075
Reaction score
890
Points
128
Website
francisdrakex.deviantart.com
Flickering of surfaces in Orbiter may be caused by double surfaces. There is a surface 'below' and another one right on top of it. By chance (?) Orbiter renders either the first or the second surface, which causes a flickering effect.

This can happen if the same object is copied twice in the same location, e.g. 2 fuel tanks in one place. Try to clean your model by selecting every single object and hiding it. If you hide one, and another one shows up in the same place, then delete one.
 

wingaviator

New member
Joined
Sep 23, 2012
Messages
8
Reaction score
0
Points
0
Thank you for the feedback. I think you both may be covertly trying to get me to start this project again. :p It might be working. I do have a couple questions though that may help.

Loru, can you clarify what you mean by this "If you tried to import make orbiter .cfg type vessel?" I understand the .01m above the ground part. Not sure if I tried that when launching in Orbiter.

Francisdrake, thank you. I'm pretty sure that I went through this process when I finished the model previously, but I can try again. If memory serves this is a time consuming process. Do have a couple follow questions if you know the answer:

1) Can reversed faces cause this as well, or mainly the duplicate faces that may exist?
2) Does the ships position in the design program (Sketchup in this case) make any difference to its behavior once converted to mesh and then into Orbiter? I ask because right now the ship sits in Sketchup on the positive side of X and Y, rather than having the ships center point on the XY center point.
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
Have you tried importing the model into a different editor--Wings3D, for example?
 

wingaviator

New member
Joined
Sep 23, 2012
Messages
8
Reaction score
0
Points
0
Installed Wings 3d along with Wings to .msh addon (believe you are the creator). Exported to 3ds from Sketchup. Imported to Wings. Its even further off the center axis, but everything I'm doing is crashing Wings. Am I trying to manipulate the object in Wings (cause I haven't even figured out how to rotate view) or just exporting to msh?

If you want to take a look, happy to upload the 3ds file.
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
Installed Wings 3d along with Wings to .msh addon (believe you are the creator). Exported to 3ds from Sketchup. Imported to Wings. Its even further off the center axis, but everything I'm doing is crashing Wings. Am I trying to manipulate the object in Wings (cause I haven't even figured out how to rotate view) or just exporting to msh?

If you want to take a look, happy to upload the 3ds file.

Rotation in Wings3d is done with the middle mouse button.

Exporting again to msh might work, but the main goal of using another 3d editor (doesn't even need to be Wings3D, something else like Blender might work too) was to see if anything jumps out as to why it might be flickering --duplicate geometry, etc. Doesn't really help if Wings chokes on the model in the first place...
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,075
Reaction score
890
Points
128
Website
francisdrakex.deviantart.com
Well, cleaning-out the model (in case you didn't do it already) is less work than starting over.

To your questions:
1. Reversed faces in the same place should not be a problem.
For example, if you have the outer skin of the vessel visible from outside (of course :) ) and a cockpit mesh, visible from inside only (face normals reversed) this is not a problem.

But maybe check your modelling program, if it creates double-sided meshes. Usually it should not (as this doubles the number of polys).

My desparate measure for screwed-up meshes:
- Make a copy of the model in the modelling program.
- Delete an object in the trouble area.
- Convert to Orbiter mesh.
- See if the problem persists.
- If yes, delete another object, convert to msh, check, until the problem vanishes. The last one deleted is the trouble-maker.

Note: I assume an export script is used to create the Orbiter-msh files.
If this script is accidently interrupted, it may leave some temporary copies of objects in the model.

2. Yes. The origin of the mesh should be in its mass center.
If not, the mesh in Orbiter rotates around the off-set origin, e.g. when using rotational RCS. Also the resulting thrust vector of the main engines shall point through the mass center = mesh center. Otherwise it would create an unwanted rotation when the engines are on.
 

Loru

Retired Staff Member
Retired Staff
Addon Developer
Donator
Joined
Sep 30, 2008
Messages
3,731
Reaction score
6
Points
36
Location
Warsaw
Loru, can you clarify what you mean by this "If you tried to import make orbiter .cfg type vessel?" I understand the .01m above the ground part. Not sure if I tried that when launching in Orbiter.

How can you make your mesh appear in orbiter?

-As a base object?
-As vessel using only .cfg file (for example my Orbiter/Config/vessels/carina.cfg) where you only define basic parameters
-As spacecraft3/generic vessel type?
-As custom .dll coded add-on?
 

wingaviator

New member
Joined
Sep 23, 2012
Messages
8
Reaction score
0
Points
0
Thank you. I’ve been reducing the model in general. I’m looking for duplicate faces while removing features that served no practical use in Orbiter.

For example, the windows on the side had a separated double pane to create a dim light effect. For now these are being reduced to a one-piece face. I can add windows back on later if the model works.

Also, Sketchups ability to transform a component into a animated object is great, however I believe within the Orbiter world things are not this simple, therefore I am reducing the number of animated items. I have a feeling that the ones left will take a bit of learning (or someone who is awesome enough to help) to achieve.

I will keep this thread posted on what happens with the model itself, however have one additional question. Its been a long time since I’ve tried putting the model in Orbiter, but if memory serves I was exporting from Sketchup. Importing with Blender then exporting as mesh. Finally I was using ShipYard to help me create the necessary Orbiter files needed. This may be where part of the problem was. Let alone that I found ShipYard incredibly hard to visualize where thrusters and gear points were going. But even when I just focused on the model and gear points in ShipYard it was still a challenge.

Does anyone have recommendations for making this easier, or do I just have to learn the coding portion of the config creation?

Assuming I can get the file to behave in Wings3d, I’m assuming that I can get an export of the mesh, but this still leaves the config files etc that need to be created and textures to be collected, correct? Does anyone know of a program that can help me build the ships config files, and perhaps even further such as the gear points, thrusters, etc on a visual basis?
 

Loru

Retired Staff Member
Retired Staff
Addon Developer
Donator
Joined
Sep 30, 2008
Messages
3,731
Reaction score
6
Points
36
Location
Warsaw
While I played with shipyard a bit, I prefer working with my modeler (where I'm making model in 1:1 scale already centered around origin point), and notepad where I can write things like rotation axes, angles, thruster positions etc.

My modeler (3dsmax9) can export meshes directly to msh format. Then I move to spacecraft3 for prototyping flightmodel and checking animations. After that I ship spacecraft3 INI file, mesh file and textures to pearson that codes an add-on (make it .dll based).

Does anyone know of a program that can help me build the ships config files, and perhaps even further such as the gear points, thrusters, etc on a visual basis?

I think orbiter is to nieche at the moment to create such a tool as it would be no easy task. Maybe some form of spacecraft3/generic vessel GUI but I'm not a coder so don't count on me.
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,075
Reaction score
890
Points
128
Website
francisdrakex.deviantart.com
Defining all the RCS thrusters, engine locations etc. is somewhat tedious, but not difficult. Precondition is that the model location and orientation is set up correctly in the modelling program (size 1:1, origin=center and axis orientation).

Then I just click at the location of each thruster in the modelling program, which gives the location in x,y,z. These values I write down. The vector may be easy (if it is parallel to one of the main axes) or needs a little math, if oblique.

B.t.w, the Orbiter cfg file syntax is described in the "OrbiterConfig.pdf" in the doc folder.
 

wingaviator

New member
Joined
Sep 23, 2012
Messages
8
Reaction score
0
Points
0
Thank you both, once again! :)

For those that have used Sketchup and need to center on the origin because that is not where you built, use the add-on "Center on Origin." Interesting note here though. I had to copy my model into a new instance of Sketchup to make the centering actually work. There may have been issues on the original instance of the model all along. Now to figure out how to make Sketchup spit out coordinates. :p

Got a copy of Vinka's Spacecraft3 earlier and reviewed the coding for the DG2. Seems like a good template. Question regarding the thrust (assuming I get that far):

How does the coding relate (or what should I preemptively do in the model) to make engines, thrust values, and exhaust all relate? For example in the coding I see main engine placement:

[EX_MAIN_0]
OFF=(-1,0,-7.7)
DIR=(0,0,-1)
LENGTH=12
WIDTH=1

Then I see exhaust for that engine with a different name and no point assignment:

[PARTICLESTREAM_2]
NAME=DGMain
+ several more lines of coding

Then I see the thrust force assignment under the mesh assigned name:

MAIN_THRUST=2.16e5

But not quite sure if I need to preplan naming to make this work right. If its in the manual you already pointed me to, or it just works this way and I should just follow the template that works, just want to be sure.

Reducing, cleaning, exporting, importing, exporting, coding.. oh my. So much time, so little to do.. wait - scratch that, reverse it.

---------- Post added at 03:43 AM ---------- Previous post was at 03:39 AM ----------

Loru: can you explain how you turn the .ini and config to DLL? And aside from the security that the DLL provides, is there a problem running an .ini and config instead of DLL?
 

Loru

Retired Staff Member
Retired Staff
Addon Developer
Donator
Joined
Sep 30, 2008
Messages
3,731
Reaction score
6
Points
36
Location
Warsaw
Loru: can you explain how you turn the .ini and config to DLL? And aside from the security that the DLL provides, is there a problem running an .ini and config instead of DLL?

Well - that involves c++ compiler (Visual Studio Express for example) and coding skills in c++ which I do not posses. Usually I team up with other member, where I make concept, numerical and graphical work and 2nd pearson codes it and compiles into add-on.

Pure ".cfg" vessel is most limited eg. it only provides you with the basic data, engine data, thruster placement. I'm using it as a platform for initial mesh visual testing

spacecraft3 / genericvessel (.ini) adds aerodynamic parameters, animations, custom exhaust textures and smoke trails, movable gear and limited virtual cockpit. Used by me as general prototyping tool but there a lots of add-ons that use it as final platform

.dll based craft offers most options like multiple or exotic engine types (air-breathing engines, variable ISP ion thrusters), custom visual effects (max-Q vapour, explosive bolts for separation, custom autopilots, full fledged virtual cockpit, crew management etc.) For me it's a way to go for an add-on as I usually want to include some unique features in them.

I'd recommend starting easy with creating small and simple rocket craft. Then you can make it .cfg vessel and check if it renders properly in orbiter. Next step would be making it spacecraft3 vessel with aerodynamics and animations.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Pure ".cfg" vessel is most limited
There is also "impure" .cfg vessel, which is using LUA. It's also wholly defined in the .cfg file, but with use of the stock ScriptVessel module.

So it isn't just a most limited .cfg, next a more advanced .ini and then a sophisticated .dll, but you can also create some more advanced .cfg vessels than .ini vessels.
 
Top