Hello,
I have two boxes, A1 and A2…
A1 - dimension (200,100, 100) … (x,y,z)
A2 - dimension (100,100, 100) … (x,y,z)
I’m trying to “draw” A2 in A1 starting at (0,0,0) of (relative to) A1.
Hello,
I have two boxes, A1 and A2…
A1 - dimension (200,100, 100) … (x,y,z)
A2 - dimension (100,100, 100) … (x,y,z)
I’m trying to “draw” A2 in A1 starting at (0,0,0) of (relative to) A1.
Assuming A1
and A2
are both meshes. Couldn’t you just do:
A1.add( A2 );
I did this. But I want the red box to start at the position marked in the below image
var geometry1 = new BoxBufferGeometry( 200, 100, 100 );
var material1 = new MeshPhongMaterial( {
color: new Color('blue'),
opacity: 0.5,
transparent: true}
);
var A1 = new Mesh( geometry1, material1 );
var geometry2 = new BoxBufferGeometry( 100, 100, 100 );
var material2 = new MeshBasicMaterial( {color: new Color('red')} );
var A2 = new Mesh( geometry2, material2 );
A1.add(A2)
scene.add( A1 );
Okay, I see. Maybe you can solve this by translating the geometry along the X axis like so:
geometry2.translate( - 50, 0, 0 );