Camera restriction – suggesting changes in code
See original GitHub issueI think camera restriction is not available currently.
I checked the code and made the changes locally. Can someone please implement the same in the repository?
Need Restrict the camera rotation. Example: while viewing a car model, don’t allow mouse rotation to go down.
Changes Create 6 new dependency properties X range – MinX & MaxX Y range – MinY & MaxY Z range – MinZ & MaxZ
File: HelixToolkit.Wpf.SharpDX\Controls\Viewport3DX.cs Function: ViewCubeClicked()
if (newPosition.X >= MinX && newPosition.X <= MaxX && ……..)
{
pc.AnimateTo(newPosition, e.LookDirection, e.UpDirection, 500);
}
Function: SetView() Same if() before AnimateTo()
File: HelixToolkit.Wpf.SharpDX\Controls\MouseHandlers\RotateHandler.cs Function: RotateTrackball()
if (newPosition.X >= MinX && newPosition.X <= MaxX && ……..)
{
this.Camera.LookDirection = newTarget - newPosition;
if (this.CameraMode == CameraMode.Inspect)
{
this.Camera.Position = newPosition;
}
this.Camera.UpDirection = newUpDirection;
}
The same change should be applied in all camera rotation mode.
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (9 by maintainers)
Top Results From Across the Web
Control the camera
Directly controlling a device camera requires a lot more code than requesting pictures or videos from existing camera applications.
Read more >Camera API
This package is the primary API for controlling device cameras. It can be used to take pictures or videos when you are building...
Read more >java.lang.IllegalArgumentException: Suggested resolution ...
CameraActivity}: java.lang.IllegalArgumentException: Suggested resolution map missing resolution for camera 1 at android.app.ActivityThread.
Read more >BG-FGS-start while-in-use permission restriction improvement.
This CL will add further restriction on that. 1. If the first Service.startForeground() call is more than 10 seconds (can be configured by ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created a custom camera, but still not helping.
when i simply rotate, the object goes down (target is getting changed) see the below screen.
Below is my code. Could you please copy paste the same in a new project and try to figure it…?!
MainWindow.Xaml
MainViewModel.cs
MyRestrictedCamera.cs
Notify.cs
Seems like what you need is to restrict camera position