問題タブ [picking]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
23 参照

search - searching throw a numbers and picking up the results

i have an issue in a section of my application, and i hope you help me with it, first i'll explain how it should work

i have a stable table (url below):

note (math is not useful with the table,we should pickup the results)

-

open up the table

-

how does it work:

first of all i will write a word, (a word example: power), it will be stored to a String, the app will send it to a method to analyzing it and assigning a number to each letter of that word (power), after that the method will send a String of numbers (assigned numbers of power) to the final method, the final method will work with these numbers(a numbers example: 89649) depending on the above table restricted by a rule, the rule is (check each number with the next number on of it, the first number will be vertical, second will be horizontal) finally pickup and assign the results from the table to different variables.

example (89649):

first two numbers (vertical 8) (horizontal 9) result = 72

second two numbers (vertical 9) (horizontal 6) result = 6

etc.

my method code:

the issues :

1- the app does not know the table to figure out what is the result(yes if we have kind of math), so how can i make it search throw that table

2- in the second loop, i have a problem with the (NL), to check one by one throw the arrNums, the loop should start depending on (NL), but if (NL) less than 9, so it wouldn't do it, and if i make it like this

for (int lop2 = 0; lop2 < 10;lop2 ++)

i'll have error because the length does not much the loop times.

help me please

0 投票する
1 に答える
3137 参照

three.js - three.js 正投影カメラ オブジェクトの選択

正投影カメラを使用しているシーンでオブジェクトを選択しようとしています。私のコード フラグメントは既に動作していますが、正確ではありません。私はすでにstackoverflowでいくつかの答えを見つけましたが、それらは非推奨であるか、まったく機能しません。ここに私のコード onMouseDown があります

http://jsfiddle.net/ujzpe07t/1/をご覧ください

立方体の左/右/上/下で数ピクセル離れた場所をクリックしても、オブジェクトが触れられたことがわかります。

three.js r69を使用しています。

どんなヒントでも大歓迎です。ありがとう、乾杯!

0 投票する
1 に答える
436 参照

opengl - OpenGL Glut Picking がヒットを処理しない

何かをクリックしてもヒット数が 0 になる理由がわかりません。メイン ロボットは既に動作しており、キーボード コマンドへの応答は良好ですが、何らかの理由でヒットを登録できないようです。
このチュートリアルに従おうとしています: Lighthouse Tutorial
Full Code Here: My Git Repo

0 投票する
1 に答える
154 参照

c - ピッキング時に常にズームインするのはなぜですか? (OpenGL)

次のコードがあります。

長々とすみません。一度に 1 つのオブジェクトを選択して操作できるように、ピッキングを機能させようとしています。私の印刷物によると、1 つのハードルを除いて、期待どおりに機能しています。コードをくまなく調べ、いくつかの変更/デバッグ作業を行いましたが、問題の行が見つかりません。ピッキングがこの奇妙な動作をする理由について、誰かが私を正しい方向に向けることができますか?

0 投票する
2 に答える
693 参照

mouse - SharpDX GetPickRay の問題

現在のカメラ位置/ビューからピッキング レイを取得しようとしているので、それを使用して 3D ワールドでオブジェクトを選択できます。問題は、カメラを動かすと光線がおかしくなることです。何か間違ったことをしていますか、それとも浮動小数点の精度の問題ですか?

光線の結果は次のとおりです。

画面上では、マウスの下に次の行が作成されます:
(左上)

私が理解している限り、レイはマウスの下に表示されるべきではありませんよね?
カメラを動かして、描いているレイを変更しないと、明らかに見えるようになります。

編集:カメラを動かさないと、マウスの下に光線が見えず、回転しても見えません。
edit2: ray.Position は正しいようですが、Ray.Direction は間違っているようですが、引用しないでください。