Hello everybody!
This is my first post here.
I have one Question.
I’m using PhiloGL (a WebGL Framework) to create a simple “drag & drop” engine of Objects like a Square or triangle.
My first attempt doesn’t work. The Square is following my Mouse, but it’s not relative to the cam. In the middle of the viewport it’s ok, but the farther im* going (with my mouse) to the edges of my viewport, the farther goes my Square from the Mousekoordinates in the direction of the edge. Do you know what i mean?
There is an Event for relative Mousekoordinates but i dont know how to use it.
Here is my code. (Sorry for bad englisch. )
//Create App
PhiloGL('canvas', {
program: {
from: 'ids',
vs: 'shader-vs',
fs: 'shader-fs'
},
//steuerung dreieck
events: {
relative (true);
onMouseMove: function(e) {
squareMoveX = e.x;//squareMove Koordinates are the Positioncoordinates of the Square.
squareMoveY = e.y;
}
},