# Proscene mouse postion projection from screen to scene's plane

**URL:** https://discourse.processing.org/t/proscene-mouse-postion-projection-from-screen-to-scenes-plane/12278
**Category:** Libraries
**Created:** [June 25, 2019, 12:46am UTC](https://discourse.processing.org/t/proscene-mouse-postion-projection-from-screen-to-scenes-plane/12278 "2019-06-25T00:46:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discourse.processing.org/u/Ivan)
#### Post date: [June 25, 2019, 12:46am UTC](https://discourse.processing.org/t/proscene-mouse-postion-projection-from-screen-to-scenes-plane/12278/1 "2019-06-25T00:46:07Z")

</div>

Hello!

Usually, for _zooming and panning_ I’m using **gicentreUtils** library which is great but still has an issue - small additional zooming is added at the end of the corresponding mouse gesture (SHIFT+mouseDrag). Therefore, in the new project which requires CAD-related features, I decided to use Proscene library.

Zooming&panning works great, but now I can’t figure out how to obtain information about the coordinates of the mouse pointer relative to the scene’s plane.

I would greatly appreciate if anyone could suggest an easy way of converting `mouseX` and `mouseY` values of the mouse pointer on the screen into `X` and `Y` values on the given frame (scene’s grid plane in particular).

The following is a non-working attempt to obtain the desired values:

```auto
import remixlab.proscene.*;
import remixlab.dandelion.geom.Vec;

Scene scene;
InteractiveFrame frame;

void setup() {
  size(800, 600, P3D);
  scene = new Scene(this);
  frame = new InteractiveFrame(scene);
}

void draw() {
    background(230);
}

void mousePressed() {
  // prints mouse pointer coordinates relative to SCREEN frame
  PVector screenPoint = new PVector( mouseX, mouseY );
  println( "screen:" + screenPoint );
  
  // prints mouse pointer coordinates relative to SCENE frame
  Vec worldPoint = scene.projectedCoordinatesOf( Scene.toVec( screenPoint ) );  
  println( "world:" + worldPoint.toString() );
}

```
