0

I want to change the direction in which a character is looking at spawn in three.js. I used this example https://threejs.org/examples/?q=md2#webgl_loader_md2_control and now I have that character in my scene. I took a look at https://stackoverflow.com/a/11060965/5111904 but that kind of rotation is messing up the controls of the character.

Looking in the wrong direction:

Wrong direction

Should look in that direction:

Right Direction

Is there a way to rotate the character 90° using the resources of the three.js example? How can I change the "spawn direction" of the character?

Community
  • 1
  • 1
Matthias Herrmann
  • 2,650
  • 5
  • 32
  • 66

2 Answers2

0

look at camera.position.set( 0, 150, 1300 ); and try some different values there.

An other idea is to load the model into a 3D software and rotate it there, but I would not recommend that.

hhq
  • 3
  • 3
0

I looked up the basic movements (left right) in the MD2CharacterComplex.js because I thought the character needs to rotate in that animations as well.

I found the attribute bodyOrientation which is the angle of the character - in other words the direction in which the character is looking.

After adding the character to the scene - this piece of code now "rotates" the character making it look in the opposite direction.

character.bodyOrientation = 90

Matthias Herrmann
  • 2,650
  • 5
  • 32
  • 66