I us\d rect on the picture to mention place that i wanted \ bind into \ arrow
that is how it looks in blender
the result is this
i may bind independently each edge, but there are many edges
what is a distance between?
solution \ change z coordinate of rect in blender,
it will change shape of geometry for entire object
it provides result with higher precision through height
real solution \ is how threejs bind glb object into threejs coordinates
meanwhile it expectd to work out of the box
\ how it works \
binds to geometry center of blender object
\ expectd \
bind to cursor of blender object
\ updatd
it fixed my issue \ thx
what about issue with atan2?
on first samples it \ good, on some samples it is different
how to solve?
@manthrax
I tried to use quartenion, it gives not correct rotation for bottom left
I think you want the origin of your ship mesh to be its pivot point.
In blender, select it in edit mode.. and make sure the geometry is centered around the models “origin”…
Or parent your ship model to an “empty” that is the pivot point.
Then you can just change the empty.rotation.y to make it rotate.
Looks cool
atan2? Can you look at picture above, at startin it good, in later samples harder to debug
Sorry, I am unable to assist.
I find it extremely exhausting trying to understand (linguistically and semantically) your posts. I am completely lost at what is the expected behaviour and what is the observed behaviour.
I hope someone with a better understanding of the issue might provide help.
In threejs you are using variables a b c to define expression (sample quartenion)
I am unable to use a b c cause these character are mine first name, surname and name of father
The reason why I am using \ characters
a b c are already defined in my local scope
That is
Where to find help with math then?
I believe you can find help with math here, in this forum, if your question is clearly stated.
how it is defined
/* sample-pick-direction.js */
let retrieveRadialArr = function(/*startinFrom*/ fromPassdSample, throughDirection,
throughDistance, rotationApplied /* closin */) {
let fromPassdZ /* keep */ = fromPassdSample.z
let fromPassdX /* keep */ = fromPassdSample.x
const particlesFromPassd = /* 124 */ 384 /*124 *2*/;
const angleIncrementFromPassd = (2 * Math.PI) / /* particles */ particlesFromPassd;
let radialArrLocal = [/* keep */]
let directionArrLocal = [/* keep */]
function computeRadialArr() {
for (let i = 0; i < particlesFromPassd /*Array.from(Array(particlesFromPassd)).slice(0, 4+4+4+4 +4+4+4+4).length*/; i++) {
const angle = i * angleIncrementFromPassd;
const lookAtX = /*-28*/ fromPassdX /* + */ /* + */- throughDistance * /* Math.cos */ Math.sin(angle);
const lookAtZ = /* -14 +15 */ fromPassdZ /* + */ - throughDistance * /* Math.sin */ Math.cos(angle);
const lookAtPoint = new THREE.Vector3(lookAtX, /* -0.5+0.5+0.5-4-10-10-4-4-4-4-0.5-20-20-20-20-120-20-20-20-20 */ 0.1, lookAtZ); // Look at point on the grid
const fromFound = Math.atan2(fromPassdZ - lookAtZ, fromPassdX - lookAtX)
directionArrLocal.push(/* keep */ Math.PI/2 + 2 * Math.PI * (i / particlesFromPassd) )
radialArrLocal.push(fromFound)
}
}
computeRadialArr()
... remainin ...
}
module.exports.retrieveRadialArr = /* keep */ retrieveRadialArr
how to use
let { directionArr, radialArr } /* keep */ = sampleThroughPickDirection.retrieveRadialArr(/* keep */)
let fromPassdDirection = function(startinFrom, end) {
/* keep */
let lookAtZ = end.z
let lookAtX = end.x
const fromFound = Math.atan2(startinFrom.z - lookAtZ, startinFrom.x - lookAtX)
let fromPassdRotation
for(let i = 0; i < radialArr.length; i++) {
if(radialArr[i+1] < fromFound && fromFound < radialArr[i]) {
fromPassdRotation = directionArr[i+1] /* + Math.PI/2 + Math.PI/2 */
break
}
}
return fromPassdRotation
}
this works good, for first samples
but then direction is different, it expected to be straight with profile glb model
p[A]vel[B]oy[C]hev contains the characters you’re supposedly claiming are predefined in your “scope” (whatever that means)
? I wonder does that mean it’s not possible for you to @ him in posts? This makes it really difficult to understand and help you and quite frankly is going to be less productive for you finding solutions in the long run on this forum.
I would suggest you do a little preliminary formulation on exactly the issue you need help with here, for example the object you need help with in images coloured in a way you can tag and explain as well as an attempt at visualising the expected result eg “the blue line needs to align with this particular point on the model” or “the model needs to align with this particular blue line’s direction” and even provide a minimal example on codepen, js fiddle or codesandbox that demonstrates what might be causing you problems…
Making it difficult for people to understand and help you will inevitably result in people not wanting to have to try to decipher what you need help with, which is a shame as there are a lot of knowledgeable people who would otherwise be willing to point you in the correct direction and even provide practical examples for guidance on how to help solve the issue you’re struggling with…
it taken a few month to write the code
and takes some time to decipher it from code into the language
despite underground character may have different meaning in math and physics
const s2 = sin( b / 2 );
const c13 = cos( ( a + c ) / 2 );
const s13 = sin( ( a + c ) / 2 );
const c1_3 = cos( ( a - c ) / 2 );
const s1_3 = sin( ( a - c ) / 2 );
const c3_1 = cos( ( c - a ) / 2 );
const s3_1 = sin( ( c - a ) / 2 );
i prefer meangful naming of variables and i am not creator of color transforming library (eg hsl to rgb) either threejs
let me do sandbox sample
@Lawrence3DPK
@Lawrence3DPK @PavelBoytchev
send public RSA \ I’ll share repo on github
bro you’re asking too much.
Just post code. Nobody here wants to steal your bugs. ![]()
@PavelBoytchev @manthrax
What open solution I may use to post code into sandbox?
I checked, some of them are paid
I use codepen.io, the free version has some limitations, here is an example:
https://codepen.io/boytchev/pen/emgrqRj?editors=0010
But do not pour all your code, especially if it is too long. Create MWE (Minimal Working Example), that is:
But you also need to explain in words or diagram what is the intended result, because in many cases just showing a picture or a video and saying it does not work is not sufficient.
Personally I cannot understand 90% of your posts, that is why I already stated I cannot assist.
Codepen is paid, threejs is open source
In 2014 I did sandbox editor for html and css
Not all things are working through eval
I think it is possible to adapt it into threejs
With minimal server
What do you think?
@PavelBoytchev
To demonstrate your issue with Math.atan2 you should not need the extra features that come with paid options.
As for editor, I think Sean Bradley (@seanwasere) has made one: https://editor.sbcode.net/
it says that size of threejs is large, i have only usdt to purchase starter version
there is no crypto unfortunately
@PavelBoytchev
i may use cdn
how to fix cors for these imports
"three": "https://raw.githubusercontent.com/mrdoob/three.js/refs/tags/r174/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://github.com/mrdoob/three.js/blob/r174/examples/jsm/controls/OrbitControls.js",
}
found
on localhost it works through \ start mouse click into mouse click closin (video)
on codepen \ start mouse click into mouse click closin \ click \ repeat \
issue
I mention top right rect
←
there is Math.atan2 computed differently
expectd
arrowHelper’s line and line of brush model expected to have same direction line in top right rect
I really cannot assist you.
Math.atan2 in your code, so I have no idea where to lookIs this true?