You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
question. in react, on initial loading,
want to use both zooming and rotating.
a little bounging in zoom and rotate too.
say for this as showup effect.
for examle,
say on first load,set zoom 0.7, rotate -20 degree..
during 300 ms, want apply both zooming to 1.1 and( ) rotating to 5.
then biunce back to zoom 1.0 and rotation 0.
any good way to do this?
I really appreciate if you give me a hit.
thanks in advance.
The text was updated successfully, but these errors were encountered:
Hello @ctxwing
You can set initial zoom and camera angles with our options (initialZoom, yaw, pitch, pivot)
After when View3D's ready event is triggered, which means your 3D model is loaded, you can apply animations with view3d.camera.reset().
You can use easing functions for the bouncing effect.
I didn't test the below script, but here's a rough way to how.
importView3D,{Pose}from"@egjs/view3d"constview3D=newView3D(el,{initialZoom: 0.7,yaw: -20})functioneaseOutBack(x: number): number{constc1=1.70158;constc3=c1+1;return1+c3*Math.pow(x-1,3)+c1*Math.pow(x-1,2);}view3D.on("ready",async()=>{// new pose to changeawaitcamera.reset(300,easeOutBack,newPose(0,0,1));});
question. in react, on initial loading,
want to use both zooming and rotating.
a little bounging in zoom and rotate too.
say for this as showup effect.
for examle,
say on first load,set zoom 0.7, rotate -20 degree..
during 300 ms, want apply both zooming to 1.1 and( ) rotating to 5.
then biunce back to zoom 1.0 and rotation 0.
any good way to do this?
I really appreciate if you give me a hit.
thanks in advance.
The text was updated successfully, but these errors were encountered: