tSize(window.innerWidth, window.innerHeight) ĭ(renderer.domElement) Ĭonst geometry = new THREE.PlaneGeometry(chunkSize, chunkSize) Ĭonst material = new THREE. Create sceneĬonst camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) Ĭonst renderer = new THREE.WebGLRenderer() I also set the initial window position to 100, 100, I dont know if that is relevant to the issue though. I have created the circle, but I cannot seem to be able to map my mouse coordinates to the world coordinates using glOrtho. So when i click on left-top corner of the plane, I want to get the coordinate in the matrix (0,0), and when click on the right-bottom corner of the plane - (9, 9) coordinate Setup the sceneĪdded there a little description too // 1. I have been trying to learn OpenGL and my current goal is to move a circle on mouse drag. Let's say the ChunkSize parameter is 10, which means I have an imaginary 10x10 matrix. When I click on a plane, I want to determine to which "imaginary matrix" coordinate belongs this world coordinate (intersaction coordinate). I'm using a PerspectiveCamera which follows the player's position. Also i have another object, let's call it a player, that moves on our plane. The position can be displayed simply as (x,y) where x and y are coordinates of the. I set the size of the plane based on the chunkSize parameter. The application should display the current position of mouse pointer. I will be very grateful for your help! Description: Hi! I faced a tricky task that I can't solve for a long time. How To : Find X and Y coordinates on any screen + resolution TechNiiX 843 subscribers Subscribe 74K views 11 years ago This small, free and standalone program will simplify any task where you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |