English 中文(简体)
从移动电话网获得x, y, z Value
原标题:get x, y, z values from Phonegap compass

i am developing an augmented reality application with my team. we decided to choose phonegap as framework for developing it as a webapp. We use the Three.js framework to draw the augmented reality into the canvas.

My problem is to get the camera rotation working based on the phone movement. i searched through the internet for a few days but can t get it. the actual idea was to use the getRotationMatrix() method out of the android SDK and rewrite it to javascript. but the problem is to get the x, y, z data from the compass. phonegap only provides heading relative to the geographic north pole in degrees (0 .. 360) but the getRotationMatrix() method uses the x, y, z values.

能否将轴心价值从标题价值中删除或直接取走?

是否有其他想法来计算所有三个轴心的照相轮换?

感谢你们的心灵。

最佳回答

You can use html5 deviceorientation. It works great

I add a tutorial about it: http://html5rocks.com/en/tutorials/device/orientation

问题回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签