yomotsu / meshwalk

for your TPS game development with three.js.
240 stars 42 forks source link

Simple edit example :: "7_allTogether.html" to es5? #4

Closed Thundros closed 6 years ago

Thundros commented 6 years ago

Hi,` Yomotsu. This is an EXCELLENT library & AWESOME demos, but can you make a simple edit to 7_allTogether.html that changes the es6 to es5? es6 & promises & I don't mix. :(

like instead of :

Promise.all( [
  loadMesh( 'terrain.json' ),
  loadMesh( 'model/miku.json' )
] ).then( function( result ) {

I want to be able to do :

var mymesh = loadMesh ( 'terrain.json' );
var mymesh2 = loadMesh ( 'miku.json' );
mymesh.position.x = 0.0;
mymesh.position.y = 0.0;
mymesh.position.z = 0.0;
mymesh2.scale.x = 1.0;
mymesh2.scale.y = 1.0;
mymesh2.scale.z = 1.0;

Thank you once again, @yomotsu !

Peace brother

*~ Thundros

yomotsu commented 6 years ago

@Thundros thanks for trying. Loading external file(s) cannot be synchronous function, such as Ajax, isnt it? How about just use Polyfill for Promise? like es6-promise.auto.js. That can be use via CDN as well.

Thundros commented 6 years ago

No problem at all! I will continue to beta test it because I absolutely LOVE it! <3 So I figured out a way around the above problem but am stuck with the ONE problem stopping me from achieving anything in my own demo & that is the ability to use this EXACT camera with the tween library :: https://github.com/joates/3rd-person-cam-easing and this demo's ability to slowly rotate the character but allow for the camera to tween ( also in this demo by joates ). If there is a smooth tweening camera that can do what the link to the demo I have given does, this should be 100%! <3 I am willing to beta test if you can help add this small feature from above mentioned demo! Thanks again @yomotsu for ALL that you do! I've ALWAYS admired your work! <3

*~ Thundros

yomotsu commented 6 years ago

Thank you again for your cooperation. I guess that can be done with pure three.js camera.

  1. prepare 2 cameras
  2. Animate 1st camera with camera.lookAt() and render your scene with the camera.
  3. when the animation ended, swap the 1st camera with 2nd camera(which is TFP camera), and render scene with TPS camera

(sorry if i was misunderstanding for your question

Thundros commented 6 years ago

I apologize whole-heartedly. I do not understand. I just want to use the camera from https://github.com/joates/3rd-person-cam-easing in this demo.

Thundros commented 6 years ago

That's all I meant. <3

yomotsu commented 6 years ago

You can use any camera whatever. Although meshwalk.js provides TPSCameraControls, you dont need to use it. Just use a camera (and cameraContorls) you prefer.

You might need to learn about three.js little bit more

Thundros commented 6 years ago

Edited

Thundros commented 6 years ago

Excellent as always, @yomotsu ! Thanks again brother!

~*Thundros