Giter Club home page Giter Club logo

Comments (2)

WoodNeck avatar WoodNeck commented on May 21, 2024

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.

import View3D, { Pose } from "@egjs/view3d"

const view3D = new View3D(el, {
  initialZoom: 0.7,
  yaw: -20
})

function easeOutBack(x: number): number {
  const c1 = 1.70158;
  const c3 = c1 + 1;

  return 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2);
}

view3D.on("ready", async () => {
  // new pose to change
  await camera.reset(300, easeOutBack, new Pose(0, 0, 1));
});

from egjs-view3d.

ctxwing avatar ctxwing commented on May 21, 2024

@WoodNeck .
sorry for late responding.. thats awesome.. thanks . I will try to appy. thanks again

from egjs-view3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.