Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

353
Visualizações
Spark AR Studio, plane tracker get vector target position based on target rotation

I am trying to create parabola logic for Spark AR studio using only javascript (without patches)

there is a limitation to my project

  1. No world/local transform patches/code
  2. Patches only used for sent vector3 position and rotation to script

Okay, I have 1 parent object with 1 child.

object inspector

  • Ball for control rotation and position
  • Fussball.001 only adds position z vector to make the ball in front of the player's foot

ball and Fussball differences

My goal is I want to kick the ball to the target based on the rotation of Ball, for example, the ball position is 0,0,0, and ball rotation is 0,45,0, so the ball target is -0.51721, 0, -0.51721 it's just example, here's simulation if I do it in spark ar viewport

example in viewport

I know I can create easily with getting object global transform, but the problem is global transform is sucks if I use inside plane tracker. for now my script only like this, just get the vector position and rotation only and send it to patches

  var target_position = null;

  target_position = [0, 0, 0];

  const [x, y, z, rotationY] = await Promise.all([
    Patches.outputs.getScalar("x"),
    Patches.outputs.getScalar("y"),
    Patches.outputs.getScalar("z"),
    Patches.outputs.getScalar("rotationY"),
  ]);

  x.monitor().subscribe(() => {
    target_position[0] = x.pinLastValue();
  });

  y.monitor().subscribe(() => {
    target_position[1] = y.pinLastValue();
  });

  z.monitor().subscribe(() => {
    target_position[2] = z.pinLastValue();
    Time.setTimeout(() => {
      Patches.inputs.setVector(
        "ball_shooting_target_position_sender",
        Reactive.vector(
          target_position[0],
          target_position[1],
          target_position[2]
        )
      );
    }, 50);
  });

  rotationY.monitor().subscribe(() => {
    Diagnostics.log(rotationY.pinLastValue());
  });

I think this case is similar with web-based javascript game, but i don't know the correct keyword to search it through google. Thanks

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda