Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Tutorials & Challenges
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Tutorials & Challenges Feel free to publish your tutorials, challenges, & flight scenarios in this forum.

Reply
 
Thread Tools
Old 09-21-2008, 10:19 PM   #1
JMW
Aspiring Addon Developer
 
JMW's Avatar
Default Disappearing mesh parts

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
JMW is offline   Reply With Quote
Old 09-22-2008, 12:38 AM   #2
MajorTom
Ker-splash!
 
MajorTom's Avatar

Default

Could it be as simple as setting the vessel size (in meters) correctly?
MajorTom is offline   Reply With Quote
Old 09-22-2008, 12:48 AM   #3
martins
Orbiter Founder
Default

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.
martins is offline   Reply With Quote
Old 09-22-2008, 01:03 AM   #4
Zatnikitelman
Addon Developer
 
Zatnikitelman's Avatar
Default

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.
Zatnikitelman is offline   Reply With Quote
Old 09-22-2008, 02:08 AM   #5
tblaxland
Webmaster
 
tblaxland's Avatar


Default

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).
Attached Thumbnails
Ananke_Clip_Radius_Problem_20080625.pdf  
tblaxland is offline   Reply With Quote
Old 09-22-2008, 04:40 PM   #6
JMW
Aspiring Addon Developer
 
JMW's Avatar
Default

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
JMW is offline   Reply With Quote
Old 09-22-2008, 04:53 PM   #7
martins
Orbiter Founder
Default

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).
martins is offline   Reply With Quote
Old 09-22-2008, 05:01 PM   #8
JMW
Aspiring Addon Developer
 
JMW's Avatar
Default

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
JMW is offline   Reply With Quote
Old 09-30-2008, 09:38 AM   #9
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

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.
gattispilot is offline   Reply With Quote
Old 09-30-2008, 10:25 AM   #10
tblaxland
Webmaster
 
tblaxland's Avatar


Default

Quote:
Originally Posted by gattispilot View Post
 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).
tblaxland is offline   Reply With Quote
Old 09-30-2008, 11:27 AM   #11
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

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:



With:



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
gattispilot is offline   Reply With Quote
Old 09-30-2008, 11:46 PM   #12
tblaxland
Webmaster
 
tblaxland's Avatar


Default

Quote:
Originally Posted by gattispilot View Post
  So I need to make a interior mesh and set in vc. So I need to switch to VC
Correct and correct.
tblaxland is offline   Reply With Quote
Old 10-01-2008, 02:19 AM   #13
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

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 by gattispilot; 10-01-2008 at 02:59 AM.
gattispilot is offline   Reply With Quote
Old 10-01-2008, 06:40 AM   #14
tblaxland
Webmaster
 
tblaxland's Avatar


Default

Quote:
Originally Posted by gattispilot View Post
 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.

Quote:
Originally Posted by gattispilot View Post
 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?).

Quote:
Originally Posted by gattispilot View Post
 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.
tblaxland is offline   Reply With Quote
Old 10-01-2008, 09:46 AM   #15
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

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.
gattispilot is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Tutorials & Challenges


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 05:16 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.