I’m trying to rotate a laser beam (which is a cylinder). But, it is supposed to have a pivot of the rotation on the edge, which is connected to the caster (a mage). But, it keeps rotating with the pivot on the center of the cylinder, so it’s not working like it should…
Can you be a little more verbose in the explanation? I don’t get it. I went to the link and GetSources but still don’t understand what you’re trying to make me see
The four lines of code are not enough to understand what you have already done and what you want to achieve.
To get good help here in the forum it is better to create a live example, e.g. jsfiddle (https://jsfiddle.net/) or codepen (https://codepen.io/).
However, the example no longer works there because it is not bound to the appropriate version of three.js.
For this reason I always store the appropriate three.js version in my collection.
The explanation of the problem that you have is rather vague, an online debuggable version would really help people here to help you.
Considering this:
I might guess that you want to define another pivot point of some model, not the one that it has by default. The easiest way to do this is to put the model in a group, so that the desired pivot point of the model is exactly where is the (0,0,0) of the group. Then, you rotate the group and … that’s all.
Here is a demo how to rotate a cylinder around its edge. The cylinder is called laserBeam (lines 41-47) and it is put inside laserBeamWrapper (lines 38-39). The rotation is done on the wrapper (line 53).
I’m not available for a discord (or any other) call.
When you add the model in the group, do you also change the position of the model inside the group? (in my demo this is done in line 45). If you do not change this position, there will be no any difference and the result will be the same.