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

290
Vistas
How Can I make a 3D object move in JavaScript Annot3D PDF?

I am trying to have a 3d object move either by Vector3 or Matrixes. Documentation is vague.

//////Code/////////

myKeyHandler.onEvent = function( event )
{
console.println( "Key pressed with code: " + event.characterCode );


if(event.characterCode === 119){

//Up or W
v1 = new Vector3(0.0,1.0,0.0);
getAnnots3D(0)[0].context3D.sceen.nodes.getByName("node").transform.translate(v1);
}

if(event.characterCode === 97){

//left or A
v2 = new Vector3(1.0,0.0,0.0);
getAnnots3D(0)[0].context3D.sceen.nodes.getByName("node").transform.translate(v2);
}

if(event.characterCode === 100){

//Right or D
v3 = new Vector3(-1.0,0.0,0.0);
getAnnots3D(0)[0].context3D.sceen.nodes.getByName("node").transform.translate(v3);
}

if(event.characterCode === 115){

//Down or S
v4 = new Vector3(0.0,-1.0,0.0);
getAnnots3D(0)[0].context3D.sceen.nodes.getByName("node").transform.translate(v4);
}

}


runtime.addEventHandler( myKeyHandler );


////////////////////

I get the error "Vector3 is not Define". New Vector3 syntax is what is used for all the Adobe JavaScript 3D API. I have successfully rotated any 3d object with code...

////////Code///////////

// get index of page containing the Annot3D object (count starts at 0)
pageIndex = this.pageNum;
// index of the Annot3D (count starts at 0)
annotIndex = 0;
// get a reference to the Annot3D script context
c3d = this.getAnnots3D( pageIndex )[ annotIndex ].context3D;
// get a reference to the node in the scene named "Axes"
axes = c3d.scene.nodes.getByName( "Axes" );
// rotate the object about the X-Axis PI/6 radians (30 degrees)
axes.transform.rotateAboutXInPlace( Math.PI / 6 );



/////////////////// 

Rotation works like a charm......How do I get to transform a 3D object to move side to side, up and down in 3d space? Any help is appreciative.

about 4 years ago · Juan Pablo Isaza
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