# Problems with mouse manipulation in GLMakie

**URL:** <https://discourse.julialang.org/t/problems-with-mouse-manipulation-in-glmakie/102957>\
**Category:** Visualization\
**Created:** [August 18, 2023, 3:21pm UTC](https://discourse.julialang.org/t/problems-with-mouse-manipulation-in-glmakie/102957 "2023-08-18T15:21:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwlidar](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mwlidar](https://discourse.julialang.org/u/mwlidar)\
**Post date:** [August 18, 2023, 3:21pm UTC](https://discourse.julialang.org/t/problems-with-mouse-manipulation-in-glmakie/102957/1 "2023-08-18T15:21:54Z")

</div>

Hi,

maybe I’m simply too untalented, but I am not able to manipulate the MWMesh below with the mouse in such a way that the two colored faces are visible to the left and right. Im able to view it from all other perspectives but not this one. Also sometimes the rotation is counter-intuitive: I make a move with the mouse to the right and the mesh turns to the left…

What am I doing wrong?

```julia
    using GLMakie
    vertices = [
        0.0 0.0 0.0;
        1.0 0.0 0.0;
        1.0 1.0 0.0;
        0.0 1.0 0.0;
        0.0 0.0 1.0;
        1.0 0.0 1.0;
        1.0 1.0 1.0;
        0.0 1.0 1.0;
    ]
    
    faces = [
        1 2 3;
        3 4 1;

        5 6 7;
        7 8 5;
    ]
    
    colors = [:red, :red, :red, :red, :blue, :blue, :blue, :blue]
    
    scene = mesh(vertices, faces, color = colors, shading = false)

    display(scene)

```

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [August 18, 2023, 3:28pm UTC](https://discourse.julialang.org/t/problems-with-mouse-manipulation-in-glmakie/102957/2 "2023-08-18T15:28:45Z")

</div>

The camera has lots of tweaking options, which may help with your issue:  
[https://docs.makie.org/stable/documentation/cameras/index.html#3d\_camera](https://docs.makie.org/stable/documentation/cameras/index.html#3d_camera)

Also @ffreyer is currently [reworking the camera](https://github.com/MakieOrg/Makie.jl/pull/2746).

And there is also a [PR](https://github.com/MakieOrg/Makie.jl/pull/2944) for a nice gizmo to better control the camera:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/2/a20f2a5a0f83dd11befda1e334094b4ba772a70c.jpeg)

If you could try these out and give feedback, it would greatly help merging those for the next release!

---

<div class="post-metadata">

**Author:** ![ffreyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffreyer/32/21569_2.png) [@ffreyer](https://discourse.julialang.org/u/ffreyer)\
**Post date:** [August 19, 2023, 12:09pm UTC](https://discourse.julialang.org/t/problems-with-mouse-manipulation-in-glmakie/102957/3 "2023-08-19T12:09:15Z")

</div>

> [@mwlidar](#):
>
> Hi,
> 
> maybe I’m simply too untalented, but I am not able to manipulate the MWMesh below with the mouse in such a way that the two colored faces are visible to the left and right. Im able to view it from all other perspectives but not this one. Also sometimes the rotation is counter-intuitive: I make a move with the mouse to the right and the mesh turns to the left…
> 
> What am I doing wrong?

By default the camera restricts rotations in such a way that you can’t make another direction the “up” direction. You can lift this restriction with

```julia
f, a, p = mesh(vertices, faces, color = colors, shading = false)
cam = cameracontrols(a)
cam.attributes.fixed_axis[] = false

```

Independently from the camera you can also rotate the mesh itself with `rotate!(p, 0, pi/2, 0)`

---

<div class="post-metadata">

**Author:** ![mwlidar](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mwlidar](https://discourse.julialang.org/u/mwlidar)\
**Post date:** [August 20, 2023, 8:23am UTC](https://discourse.julialang.org/t/problems-with-mouse-manipulation-in-glmakie/102957/4 "2023-08-20T08:23:41Z")

</div>

Thanks very much! Setting fixed axes to false did the trick! I hadn’t tried it before since for me the documentations seems to imply that the default value is false anyway. Is there a reason why it is true by default now?
