Disappearing mesh parts

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
670
Reaction score
89
Points
43
Location
Happy Wherever
Hi, tried to start a thread with this in SDK with no success.
Can anyone here help?
I'm trying to create a "refuelling in atmospheric flight" scenario.
Every time the two craft are nearer than 100 metres or so the end of the "refuelling" line disappears in vc view.
How or what can I "readjust" to stop this happening so that I can line up with the line?
I've read something about SetMeshVisabilityMode parameters and have tried a few things, but without success.
Thanks in anticipation.
JMW
 
Could it be as simple as setting the vessel size (in meters) correctly?
 
Try to increase the clip radius (VESSEL::SetClipRadius) of the vessel that extends the fuel line so that the clip sphere encloses the complete line.
Note that there is a hardcoded minimal clip radius of 2.5m around the camera (imposed by dynamic range constraints of the single-precision arithmetic of the render engine). If the fuel line gets closer to the camera than that, there will still be clipping.
 
Artlav I think built a module that reduces the clipping radius down to 0.01m I think really for UMMU. I know it's not something you can neccessarily code in (IDK 100%, I'm assuming from what little I know of the API) but if you suggest it to your users then it might serve your purpose.
 
I believe the problem is what Martin said. I had this problem with the Ananke tether that had its centre of mass a long way from one end. Attached is a diagram I prepared at that time to help illustrate the problem. To clarify, the default clip radius sphere is centred on the tether's centre of mass. The catcher, climber and counterweight are all part of the tether mesh.

If you are writing a DLL, for more info have a look at the function SetClipRadius in the API_Reference.

If you are using Spacecraft3, your only option is to increase the "size" parameter to equal the distance from your vessel's centre of mass to the end of the refuelling line. The downside is that this will make your vessel less visible at large distances (may or may not be an issue for you but certainly less of an issue than the mesh clipping IMHO).
 

Attachments

Thanks everyone for your quick responses.
I'll get on it ASAP
Regards,
JMW


-----Posted Added-----


HI,
Adjusting the SIZE cured the disappearing mesh problem.
Next hurdle is once DOCKED to the refuel line, both craft head for the deck! (Atmospheric flight remember)
Is there a way I can fool Orbiter into keeping their individual flight characteristics whilst docked?
This is gonna be a real hard scenario to fly - haven't managed to dock manually yet -perhaps its the thought of plumiting earthwards as soon as its achieved !!
Keep breathin'
JMW
 
Changing the size parameter is a last resort, if you can't use the SetClipRadius method (i.e. if you don't write a DLL plugin). The size parameter not only affects the visuals, but also various physical parameters, so can influence flight behaviour.

Docking two vessels creates a rigid superstructure. Both vessels contribute individual forces (thrust, aerodynamics, etc.) to the superstructure, but the whole structure is defined by a single composite inertia tensor (the construction of the composite tensor from the individual vessel contributions was discussed in my 2004 ESTEC presentation). In your case, a tether-like connection may be more appropriate. This isn't possible with the standard docking mechanism, but there used to be a tether addon that might be useful for your purposes (but haven't tried myself).
 
Thanks Martin,
Tethering sounds like the answer. I'll see what I can find on it.
And THANKYOU so much for a wonderful Sim and your continued interest!
JMW
 
I have run into a similar issue. When I a vessel coded like this:
Code:
MESHVIS_ALWAYS | MESHVIS_EXTPASS)
I fixed one issue but occur another. When I ran InterMod and toggled the close view I figured the SetClipRAdius. But I have tried SetClipRAdius(.01) and no change. So I tried SetClipRadius(5); no change.

What is happening is it is clipping through the vessel. So I don't see any interior walls I have made.
 
I have run into a similar issue. When I a vessel coded like this:
Code:
MESHVIS_ALWAYS | MESHVIS_EXTPASS)
I fixed one issue but occur another. When I ran InterMod and toggled the close view I figured the SetClipRAdius. But I have tried SetClipRAdius(.01) and no change. So I tried SetClipRadius(5); no change.

What is happening is it is clipping through the vessel. So I don't see any interior walls I have made.
This is a different issue. Your vessel interior should be a separate mesh and should have MESHVIS_VC. Your external vessel mesh should have MESHVIS_ALWAYS | MESHVIS_EXTPASS. The reason is that external meshes have a minimum near clipping plane distance of 2.5m so anything closer than that to the camera will not be shown. VC meshes have a minimum near cliping plane distance of just 0.01m.

If you see my sketch above, you will see why JMW's external mesh was being clipped and why SetClipRadius would fix it (further evidenced by his statement that changing the sc3 SIZE parameter also fixed).
 
Thanks. So I need to make a interior mesh and set in vc. So I need to switch to VC or when I switch the camera F! is goes to it?

This is what I get with or with the closeup view in InterMOd
without:
eagle1.jpg

eagle1c.jpg


With:
eagle1a.jpg

eagle1b.jpg


This is the interior of an Eagle from Space1999.
Right now I have a mesh that has interior and exterior parts and just use Multiview to switch camera locations
 
I suppose I could use the same mesh as for the VC. I will need to look at the SDk and see what is needed. It is odd that by switching the close view of Inter_mod fixes this.
from the SDK guide it looks like all I need is this:
bool MyVessel::clbkLoadVC (int id)
{
...
}
or this to change the camera:
bool MyVessel::clbkLoadVC (int id)
{
SetCameraOffset (_V(0,1.5,6.0));
SetCameraDefaultDirection (_V(0,0,1));
SetCameraRotationRange (RAD*120, RAD*120, RAD*70, RAD*70);
SetCameraShiftRange (_V(0,0,0.1), _V(-0.2,0,0), _V(0.2,0,0));
...
}

I have this:
bool EAGLE2::clbkLoadVC (int id)
{
}

when I compile I get:error C4716: 'EAGLE2::clbkLoadVC' : must return a value
 
Last edited:
I suppose I could use the same mesh as for the VC. I will need to look at the SDk and see what is needed.
IIRC, you needed MESHVIS_EXTPASS to help with another rendering issue that you had. Adding the MESHVIS_EXTPASS attribute to a mesh will force it to have a minimum clipping distance of 2.5m even if the mesh is labelled MESHVIS_VC. So, no, using the same mesh will not work.

It is odd that by switching the close view of Inter_mod fixes this.
Not odd at all, that is what close view of Inter_mod is meant to do. It reduces the camera clipping plane down from 2.5m to some smaller value (not sure what value though, perhaps in the Inter_mod docs?).

I have this:
bool EAGLE2::clbkLoadVC (int id)
{
}

when I compile I get:error C4716: 'EAGLE2::clbkLoadVC' : must return a value
Add
Code:
return true;
This tells Orbiter that you have a VC.
 
That worked. I set clipradius and use the VC and got the result using the same mesh. One thing I couldn't do was work the animations ie the doors. So do I need to update the VC. When I switch the doors were open.
 
Back
Top