Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

352
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda