We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

eatdesignlove

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • eatdesignlove
    Participant

    Thank to you i figured it out!

    const vector3 = new v3d.Vector3();
    const position = vector3.setFromSphericalCoords(
    distance,
    controls.getPolarAngle(),
    controls.getAzimuthalAngle()
    );

    eatdesignlove
    Participant

    Hi,

    As you can see the screenshot i attached, in the document it shows that i need to get vector3 value for tweening.

    Unfortunately, I’m not familiar with the scalar value.😢

    {x: number, y: number, z: number} <- Is that scalar value?

    For your understanding, I write down what i want to do with the position variable’s value.

    <input id=”polarAngle”>
    <input id=”aziumthalAngle”>
    <input id=”distance”>
    <button onclick=”tweenViewClick”>Tween Viewer<button>

    function tweenViewClick() {
    const polar = document.getElementById(‘polarAngle’);
    const aziumthalAngle = document.getElementById(‘aziumthalAngle’);
    const distance = document.getElementById(‘distance’);

    // … some logic … how to..

    const postion = {x:.. , y:.., z:.. } // Calculated polarAngle, aziumthalAngle, distance.

    app.controls.tween(postion, targetPosition);
    }

    I want to know x, y, and z value by calculating polarAngle, aziumthalAngle, and distance…😢

    Attachments:
    You must be logged in to view attached files.
    eatdesignlove
    Participant

    Thank you, Ivan!!

Viewing 3 posts - 1 through 3 (of 3 total)