SDK Question what's the meaning of the ''size"

weiqi

New member
Joined
Feb 20, 2009
Messages
23
Reaction score
0
Points
0
I have read about the SDK/samples/hst.h file , I can't understand the 'hst_size' parameter, can you help me?
 
The code passes it as an argument to the VESSEL::SetSize function. That in turn lets Orbiter know how big the vessel is, as rough measure (ie, mean radius), so that it can perform calculations on whether or not the vessel mesh is visible from the current camera location. It is also used in setting the vessel's default clip radius.
 
From: http://www.orbiter-forum.com/showthread.php?p=77016

The size parameter is used to indicate the average radius (or thereabouts; I typically use median) of your vessel (in meters). It has no actual bearing on the visible model; rather, it is used to calculate three things:

1: At what distance the visible model for your vessel is no longer shown, and it appears as just a spot
2: The size of that spot at a given distance
3: At what distance that spot dwindles to nothing and is no longer visible

Just fiddle with the value of Size until you have smooth-seeming transitions between all of these events.
 
It also has an impact on when the mesh disappears as you zoom in on it. (Is that the "clip radius" mentioned above?)
 
It also has an impact on when the mesh disappears as you zoom in on it. (Is that the "clip radius" mentioned above?)
Sort of.

Here's how it works (or at least my understanding of it ;)). When Orbiter does an external render pass, it considers all objects in the scene, their distance to the camera and their respective clip radii. Orbiter adjusts the camera clip plane distance so that it does not intersect any clip radius, but with a minimum clip plane distance of 2.5m.

For example, consider a scene with only one vessel in it. It has a mesh 10m long and the clip radius has been set to 2.5m. This mesh will always be clipped, no matter how far away from it you get*. Now introduce another vessel to the scene that is closer than the first one. The first vessel's mesh is now not clipped because the clip plane distance has been shortened to accomodate the second vessel.

The minimum clip plane distance of 2.5m means that if you get within 2.5m of any part of a mesh, that part will be clipped. This cannot be changed (except I think Artlav had a hack, ahem, plugin that reduced the minimum clip plane distance). The minimum clip plane distance for internal render passes is 0.1m, so that virtual cockpits are rendered with little to no clipping. This comes at a framerate cost.

BTW, spacecraft3 addons cannot set the clip radius size. The clip radius is set to Orbiter's default, ie, clip radius = size.

* Perhaps there is a limit, there is no mention of maximum clip plane distance in the documentation. If there is a maximum, it is quite long, as I discovered when working with Ananke.
 
I find that the SIZE parameter in SC3 relates the the distance at which a vessel is seen when it is first generated - as when a Spacecraft3 vessel is jettisoned as a payload. By making the various parts the same SIZE you can minimize camera jumps as Orbiter shifts focus from a spent booster to a payload.
 
I find that the SIZE parameter in SC3 relates the the distance at which a vessel is seen when it is first generated - as when a Spacecraft3 vessel is jettisoned as a payload. By making the various parts the same SIZE you can minimize camera jumps as Orbiter shifts focus from a spent booster to a payload.
Yes. I think when orbiter changes focus of an object, it adjusts the camera distance to maintain the same angular size, based on the SIZE parameter.
 
Back
Top