Hi I’m using the orbit-camera script but i want to offset is in the x slightly. I’ve tried to modify a few things but cant get anything to work. To show you what I am trying to do, here is an image of the app with the UI. As you can see, the camera and focus point need to be offset to the left because the UI covers the left third of the screen. With the default script the focus point at the start is always dead center of the screen which is incorrect for this purpose…
I tried to modify the line as follows but didn’t seem to do anything at all: this.resetAndLookAtPoint(resetPoint, new pc.vec(this._modelsAabb.x+10,this._modelsAabb.center.y,this._modelsAabb.center.z));
Maybe I could have two cameras at the same position/transform always. One for the UI (UI Layer only) which renders fullscreen as normal and one for the 3D with which I just offset its viewport X. Would that work? Any disadvantages to that?
screenPosition doesnt take into account any of the viewport offset so none of the interactions trigger correctly with a raycast. ANyone know how to get around this? Some way of getting the ray to know about the viewport offset?
It’s probably related to pixel device ratio if the issue is on mobile only. Debug with the touch screen coordinates and see if they are larger/smaller than what you would expect for the screen resolution on the mobile device
I have Device Pixel Ratio enabled but if I turn this off IT WORKS, but sprites look rubbish I cant live with that. I guess I need an additional offset for mobile to based on the Device Pixel Ratio. ANy ideas how I would do that?!?