[Help] Need to use Waypoint perspective

Objective: The need to achieve waypoint perspective instead of orbital perspective, as found in this codepen

Issue: When I orbit around my origin point, I sometimes collide with the wall which creates this glitchy effect…

I believe if I can somewhat achieve the setting of navpoint as found on the codepen, it would allow me to rotate on my origin itself instead of panning while orbiting ( which causes my camera to go inside the wall for a minute )

Example Link: LookAround-Simulation (forked) - StackBlitz

On this example link you can find ourselves very close or near to a purple beam going upwards… Once I start orbitting, you may notice that despite our origin is outside and near the purple beam, during rotation it will push you inside the purple beam or cause the glitchy…

Is there anyway we can fix this?

Apologies if this might be abit confusing, You might want to use fullscreen for the glitch to happen…
Here’s a preview: Parcel Sandbox - 5 March 2025 | Loom

I see the near object glitch, but what is your expected behaviour for collisions?

I’m fine with the glitching if it collides, but if the object is near, why isn’t it rotating around it’s origin … it kinda seems it is panning around in small circle causing it to collide with the object… Like for instance if I’m completely zoomed into my origin, it should rotate around the axis, but rotating kinda moves me into objects abit…

Right that’s clear. I’ll defer tho to the viewer team to reply. Bear with us.

1 Like

I’m not sure if it helps, the codepen I shared, when I toggle to nav view point, and I zoom in completely, it allows me to rotate around my point … I understand zooming out and or zooming in would change my origin, which I can restrict and utilize fov to zoom in and zoom out…

Hi @Ahmed_Jamil

The stackblitz you forked was originally meant to provide the simplest possible way to simulate a ‘look around’ camera controller. You are right, the orbit controls do not make the camera rotate in place, but rater have it rotate around a point ever so slightly close to it. This is how the speckle orbit controls implementation works.

In order to achieve want you want and have the “waypoint perspective”, I’ve made this live example that is a fork of your fork and it adds a button that toggles between orbit and waypoint perspective. This is done by simply toggling between the orbit and fly controls, which are both available on the default camera controls. The fly controls will rotate the camera in place.

Cheers

1 Like

Many thanks, this was helpful and achieved what I wanted

2 Likes

There’s something that I noticed, after turning on the waypoint perspective by using the toggleControls(),

I noticed that orbitalSensitivity has no impact, I have set it to -1 but it does nothing…

I was also utilizing the setCameraView control to pan or fly (rotate) ( I was using another reference screen to cause that impact here ) For Example
I resorted to using fromPositionAndTarget, this allowed me to influence the rotation in speckle from another functions…

The issue however is that , I noticed that in waypoint perspective it has a range for yaw from -π to + π, as soon as I rotate (yaw from left to rotate full 180* ) it glitches between the transition from +π to -π.

In simple terms, the yaw works in -180 to +180 degrees, so if you have rotated in yaw for around 178*, and as soon as you complete the rotation ( exceed from 180* , it enters the -180* region) it causes a small visual spin ( glitch )…

Video example

When switching to fly controls, by calling toggleControls, orbitalSensitivity has no longer any meaning. The option you want to set is lookSpeed

As for the issue you’re describing, I’m going to need a way to reproduce or at least the code you are using to rotate while using the fly controls(waypoint perspective) where PolarViews no longer work.

The fly controls are meant to be used as FPS camera controller, so there are no polar coordinates. That’s why I need to see how are you programmatically rotating the fly controls (waypoint perspective) using yaw and pitch. A stackblitz would be ideal because I could edit it then and there

Cheers

We tried to mimic the viewer change, here’s an example .

If you pan around 180degrees, you should see the glitch happening.

Thanks

Here’s a video example:

I think you pasted the wrong link, I’m getting this when accessing the stackblitz link

@alex sorries, I accidentally shared the link of the container instead of the code. Updated the link, Thanks

All good now. Thanks for the example! We’ll look into it

1 Like

Hi @Ahmed_Jamil

Had a look at your issue and indeed the jump happens because we use linear dampers for angles which do not know to properly interpolate angles. There’s already a PR where we replace linear dampers with angle dampers that fix the issue, however we’re currently in a release freeze cycle.

That’s why I’ve made this live example which fixes your issue the same way but without you needing a new version for the viewer

Cheers

1 Like

Many thanks for this @alex , means alot. The workaround is amazing

2 Likes