Well, I’m not sure if this is a bug or if I messed something up.
If I use the old element that I wanted to write as plug-in in the editor, it works fine, but as soon as I write the exact same code in VS and compile it, it exponentially increases the cameras distance:
I was able to comment out everything and it looks like reading the vp.CameraLocation point when in a parallel projection view window makes it behave funny.
Hi @dale
thanks for your answer and sorry if I wasn’t clear.
I could attach the file, but the error is not reproducable within the script editor. I hope the new gif will be better.
the only code inside SolveInstance is as shown in the first post. Do you want me to make a project with just these two lines?
in this hopefully better quality you can see the upper element is basically the equivalent as plug-in than the lower element from the old script editor.
It’s the preview.
Your point being shown on screen, the preview, cause the camera bounding box to recalculate now with also that point, and the bbox is now bigger, so the camera change position too, and again and again and you have your problem.
Your c# script have its own preview turned off.
Your compiled component have the preview on, instead.
I guess you’ll have the same problem with the c# script if you turn on its preview.
I had this problem too in past. I have no solution.
Maybe make a bigger immutable target for the camera bbox?
Edit:
Another workaround, maybe output your xyz point coordinates as a vector instead, vectors are not “visible” per se… they do not interact with camera bbox… haven’t tested.
Conversion from vector to point is quiet and lossless…