tag:blogger.com,1999:blog-8577130439755471155.comments2017-05-21T04:11:48.110+02:00WebGL FactoryDenis Tosichttp://www.blogger.com/profile/14992340631798182965noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-8577130439755471155.post-81500569049500244192017-05-21T04:11:48.110+02:002017-05-21T04:11:48.110+02:00What is winx and winy in the below function? Is it...What is winx and winy in the below function? Is it just the width and height of the screen?<br /><br />function Point3D get3dPoint(Point2D point2D, int width,<br /> int height, Matrix viewMatrix, Matrix projectionMatrix) {<br /> <br /> double x = 2.0 * winX / clientWidth - 1;<br /> double y = - 2.0 * winY / clientHeight + 1;<br /> Matrix4 viewProjectionInverse = inverse(projectionMatrix *<br /> viewMatrix);<br /><br /> Point3D point3D = new Point3D(x, y, 0); <br /> return viewProjectionInverse.multiply(point3D);<br />}tobihttps://www.blogger.com/profile/15290218194320935420noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-1445486858348984542017-02-23T09:37:53.535+01:002017-02-23T09:37:53.535+01:00please post the derivation of view matrixplease post the derivation of view matrixflavia awanhttps://www.blogger.com/profile/10668761175834768402noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-53825198473445077222017-02-23T09:37:29.384+01:002017-02-23T09:37:29.384+01:00This comment has been removed by the author.flavia awanhttps://www.blogger.com/profile/10668761175834768402noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-7776592225408410162016-05-24T07:25:58.411+02:002016-05-24T07:25:58.411+02:00hi
I am working on 3d scanner.I cant understand h...hi<br /><br />I am working on 3d scanner.I cant understand how to convert pixel co-ordinates into real world co-ordinates. <br /><br />For example I have a data set containing only (x,y) co-ordinates of some points on object in terms of pixels how can i convert them into real world units(i.e.,cm or mm)?<br /><br />thnx.mandy rhttps://www.blogger.com/profile/06180419498929319231noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-61531632010208969662016-05-10T07:16:05.695+02:002016-05-10T07:16:05.695+02:00hi
i have a 4 2dlocator (animated baked)of a simp...hi<br /><br />i have a 4 2dlocator (animated baked)of a simple plane geometry rotation and movement.<br />i need:<br />is here any simple mel script command for convert my 4 2dlocator to 1 3d locator in center of 4 2dlocator.created 3d locator with scale, transform x,y and xyz rotaion .<br />is this possible in maya i need this method for place my polyplane in my 3d scene video. with rotaion scale movement in3d but front of projected video layer no need of z movement need matched with same screen space as output of render video.<br />any idea any link any method any script any software who did this<br />please help me<br /><br />thanksAnil Kumarhttps://www.blogger.com/profile/16986076462557300122noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-25222799941161711252016-03-12T04:57:20.162+01:002016-03-12T04:57:20.162+01:00https://github.com/gracefung/webgl-codes/blob/mast...https://github.com/gracefung/webgl-codes/blob/master/lesson05/index5-2.html<br /><br />link to code Mishuhttps://www.blogger.com/profile/03413266161702579357noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-52433859860124833022015-08-26T16:23:26.582+02:002015-08-26T16:23:26.582+02:00Hey nice explanantion man :) coolHey nice explanantion man :) coolShyamkiran Garlapaduhttps://www.blogger.com/profile/09022108973940328419noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-47168276387035798272015-07-15T16:40:01.954+02:002015-07-15T16:40:01.954+02:00Image you have a point at (100, 200) on a 2D reder...Image you have a point at (100, 200) on a 2D redering surface of size 640x480.<br /><br />We can then say:<br /><br />clientWidth == 640<br />clinetHeight == 480<br />winX == 100<br />winY == 200<br /><br />Hope it helps!Denis Tosichttps://www.blogger.com/profile/14992340631798182965noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-44370287379953126712015-07-15T16:30:23.712+02:002015-07-15T16:30:23.712+02:00What are clientWidth, clinetHeight, winX, winY in ...What are clientWidth, clinetHeight, winX, winY in the 2d to 3d conversion funciton? please help.Ramshttps://www.blogger.com/profile/05849244875249850502noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-6525289117541221272015-06-02T04:17:42.609+02:002015-06-02T04:17:42.609+02:00This comment has been removed by the author.이동현https://www.blogger.com/profile/01264923092372025367noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-46136936224298210102015-06-02T04:17:40.500+02:002015-06-02T04:17:40.500+02:00Could You upload the full code again? This from dr...Could You upload the full code again? This from dropbox don't work.이동현https://www.blogger.com/profile/01264923092372025367noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-42245219396630481802015-05-14T03:06:49.037+02:002015-05-14T03:06:49.037+02:00I finally figured it out. The issue is when you se...I finally figured it out. The issue is when you set camera Z to particular value (in article 0), then world X and Y actually calculate to fit to that Z, So when you want to calculate X,Y world coordinates, you have to know for which world Z you are finding this X a Y. Once you know that. You can calculate camera coordinate Z which u can finally use to calculate world X,Y as is described in article. So how do you find the cameraZ when you know worldZ ? You have to take a Plane which contains worldZ coordinate and has normal identical to looking direction vector( it is target - eyeCoor) Once you have that plane you, have to transform it into camera space(For example by taking thre points which the plane containc, trasform them and then make from them again). And by putting camera X,Y to plane equatian you get camera Z. And That's it!Petr Geigerhttps://www.blogger.com/profile/04340140209934081875noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-44937294623701387132014-09-23T13:52:38.804+02:002014-09-23T13:52:38.804+02:00thx OP postthx OP postAndy0n7https://www.blogger.com/profile/14361319320963265788noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-20196329684525189052014-08-21T14:37:12.148+02:002014-08-21T14:37:12.148+02:00plz upload the source code.
It is not working....plz upload the source code.<br />It is not working....Pravin Deshmukhhttps://www.blogger.com/profile/08687006685483249805noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-59204572649745118952014-03-26T16:23:44.366+01:002014-03-26T16:23:44.366+01:00Yes, pleeeease!! :DYes, pleeeease!! :DMelanie Riesehttps://www.blogger.com/profile/14404724134875379128noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-33730271713403244082013-11-08T23:35:10.702+01:002013-11-08T23:35:10.702+01:00I have problem : I cant find any algorithm or prog...I have problem : I cant find any algorithm or program describe how to do conversion point 2D to 3D <br />how did I to find Z <br />point(x,y) --> point(x,y,z) <br />please help me<br /> souissi mounirhttps://www.blogger.com/profile/05202208905023633667noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-36382105258762489772013-06-27T13:59:01.453+02:002013-06-27T13:59:01.453+02:00Please refer to http://trac.bookofhook.com/bookofh...Please refer to http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/MousePicking for a detailed explanation of how x and y computed wihtout the necessity of z.<br /><br />As for glm, this is a general coding approach written with WebGL in mind, without the use of any special libraries.Denis Tosichttps://www.blogger.com/profile/14992340631798182965noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-10344208371857330292013-06-27T13:32:10.918+02:002013-06-27T13:32:10.918+02:00Should not you not divide by z to get screen coord...Should not you not divide by z to get screen coords?<br /><br />I did this using glm, and it seems to work (actual code):<br /><br />glm::vec2 getScreenCoord(glm::vec3 pos){<br /> <br /> glm::vec4 p = cameraPerspectiveMatrix*glm::vec4(pos, 1.0);<br /> glm::vec2 s;<br /> s.x = int(((p.x/p.z + 1.0)/2.0) * winWidth + .5);<br /> s.y = int(((1.0 - p.y/p.z)/2.0) * winHeight + .5);<br /> return s;<br />}<br /><br />Also, you could extract z-coord from z-buffer, something like<br /><br />GLfloat zbuf;<br />getPixelInfo(x,y, GL_COLOR_ATTACHMENT0, GL_DEPTH_COMPONENT, GL_FLOAT, &zbuf);<br />double znorm = 2.0 * zbuf - 1.0;<br />double zreal = 2.0 * clipNear * clipFar / (clipFar + clipNear - znorm * (clipFar - clipNear));<br />avocadohttps://www.blogger.com/profile/04523998532520908895noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-79759711986210411582013-06-01T13:32:47.235+02:002013-06-01T13:32:47.235+02:00Change this line
(1) double y = - 2.0 * winY / cl...Change this line<br /><br />(1) double y = - 2.0 * winY / clientHeight + 1;<br /><br />to <br /><br />(2) double y = 2.0 * winY / clientHeight - 1; <br />So, you should use the same approach as with the x-axis.<br /><br />Besides that, you will get the same result if you supstitue "winY" with "clientHeight - winY" in (1).<br /><br />Hope it helps!Denis Tosichttps://www.blogger.com/profile/14992340631798182965noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-85695169506475663982013-06-01T03:03:43.919+02:002013-06-01T03:03:43.919+02:00If the screen's origin is in the bottom left c...If the screen's origin is in the bottom left corner instead of top left, what would you need to change to convert from 2d->3d?Unknownhttps://www.blogger.com/profile/17824160784151581362noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-37025826363488985862013-05-28T09:32:26.415+02:002013-05-28T09:32:26.415+02:00fix links to the source - drop box outdated probab...fix links to the source - drop box outdated probablyUnknownhttps://www.blogger.com/profile/00634690948251125026noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-7815820360439876942013-02-14T06:27:46.552+01:002013-02-14T06:27:46.552+01:00please upload the code pleaseplease upload the code pleaseAreti Srinivasa Raghuramhttps://www.blogger.com/profile/06186765410778353708noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-10133725005929695662013-01-11T12:32:32.420+01:002013-01-11T12:32:32.420+01:00Very helpful article, thanks! :) I actually wrote ...Very helpful article, thanks! :) I actually wrote a similar article for performing the same conversion, but I'm specifically working in Maya. For people who have trouble with the normalization part, maybe you will find this useful: http://www.gouvatsos.com/how-to-transform-3d-coordinates-to-2d-screenspace-and-vice-versaAlexandros Gouvatsoshttps://www.blogger.com/profile/04654009144284421358noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-37357902377915078092012-12-29T11:22:25.955+01:002012-12-29T11:22:25.955+01:00the clear and real view provided by the latest dis...the clear and real view provided by the latest display devices make our experience real... the display system can be made more living with the correct supportives.. for beautiful home curtains and many more, you can visit..<br /><a href="http://www.saaria.com" rel="nofollow"> Projection screen company</a><br /><a href="http://www.directfromwarehouse.com" rel="nofollow">Theatrical Curtain" </a>sachinhttps://www.blogger.com/profile/11031346466629624313noreply@blogger.comtag:blogger.com,1999:blog-8577130439755471155.post-87809133672760996502012-12-15T22:27:07.441+01:002012-12-15T22:27:07.441+01:00Hi Denis,
Many thanks for the tutorial. I was won...Hi Denis,<br />Many thanks for the tutorial. I was wondering if you have a spare moment to help me work this out. I have built the example in javascript, but I am having a bit of an issue converting back from a 3d point to xy. In other words applying the viewProjectionMatrix back on the 3d point to get the normalized screen coord.<br /><br />//starting with the nomalised screen coords:<br />screen3D[0] = 0.5;<br />screen3D[1] = 0.5;<br />screen3D[2] = 0;<br />screen3D[3] = 1;<br /><br />var viewProjectionMatrix = Matrix.mult(projectionMatrix,viewMatrix);<br />var invViewProjectionMatrix =Matrix.inverse(viewProjectionMatrix);<br /><br />//apply the inverse projection view matrix get us into world space<br />var worldM = Matrix.multTranslate(invProjectionViewMatrix,screen3D);<br /><br />//I can mult this worldM matix by viewProjectionMatrix now to get back to my normalized screen coords .<br /><br />var normScreenM = Matrix.multTranslate(projectionViewMatrix,worldM);<br /><br />//However taking the worldPoint coords....<br />var worldPoint = Matrix.getTrans(worldM);<br />//...and multiplying the projectionViewMatrix to it does not work<br />var normScreenM2 = Matrix.multTranslate(projectionViewMatrix,worldPoint);<br /><br />So, I do not get the normalised screen coords from the product of (worldPoint * projectionViewMatrix). I only can get them back if I have the full matrix to multiply (worldM * projectionViewMatrix).<br />I was trying to apply the inverse ops as a sanity check make sure everything checked out. Unfortunately there is something I have missed. I can't get back to my normalised screen coords multing with the worldPoint So I'd really appreciate it if you have a moment/idea of whats wrong to help me work this brain banana out...<br /><br />Many thanks!<br />Wil handsfelloffhttps://www.blogger.com/profile/00191926171647058058noreply@blogger.com