• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Moving object according to view position?

dave hoeffgen

Resource contributor
Messages
1,439
Country
germany
Hello,
First of all: I don't have much of an idea about SimConnect programming.

My question as the title already says: is it possible to dynamically reposition an injected (scenery) object according to the global view point position?
If so, what might be the performance costs of doing that every frame?

Thanks in advance for any hint :)
 
It would be possible though I'm not sure it's trivial to get the view point. Maybe I would be able to tell more if you specified what are you trying to achieve (please hit me up in PMs, I might take a while to get back to the forum)
 
If the eyepoint is attached to an aircraft (not sure for ground/tower views though), the aircraft's position, plus the variable "EYEPOINT POSITION" plus variable "STRUCT EYEPOINT DYNAMIC OFFSET" should give you the global eyepoint position. If you also need orientation, there is the variable "STRUCT EYEPOINT DYNAMIC ANGLE" which I believe is relative to the aircraft's attitude (0,0,0 looking straight out of the aircraft) so you'll need to do some math to get the orientation relative to the ground, but it can be done.

Moving one or a handful of objects every SIM_FRAME in my experience has no noticeable effect at all. The sim moves around a lot of ground vehicles and AI aircraft every frame already.

Are you trying to get a 2D overlay effect? Because there are other ways to do that.
 
yes it's (relatively) trivial for out of airplane views. I don't know about other outside views though
 
If the eyepoint is attached to an aircraft (not sure for ground/tower views though), the aircraft's position, plus the variable "EYEPOINT POSITION" plus variable "STRUCT EYEPOINT DYNAMIC OFFSET" should give you the global eyepoint position.

Unfortunately, it's not that easy. See this old post from a former ACES dev: https://blogs.technet.microsoft.com/engauged/2007/02/01/variable-astruct-eyepoint-dynamic-offset/
The dynamic offset just gives you the temporary position deltas during a bounce (dynamic event). It will then settle back to zero offsets.

There is a way of "reverse engineering" the global view/camera position using the Direct3D view matrix, but you'll need hacks into the running FS process to get those. Ugly stuff...Tried it, failed, gave up...

However, P3D offers an offical API function for that.
 
Last edited:
Back
Top