Comments (8)
Did you try the look_at
method on the camera object? The three.js lookAt function is a function that calculates the correct rotation (https://github.com/mrdoob/three.js/blob/master/src/core/Object3D.js#L284). We tried to duplicate this in python in the look_at function (https://github.com/jasongrout/pythreejs/blob/master/pythreejs/pythreejs.py#L197)
from pythreejs.
Curiously, I'm not getting a look_at call to the camera to work. It does seem to work with normal objects in the scene, however. Investigating....
from pythreejs.
Okay, turns out the camera look_at function is overridden by the OrbitControls target. So I just exposed the OrbitControls target value. So do something like:
OrbitControls(target=(1,1,1), controlling = ...)
or if you instead do something like c = OrbitControls(controlling=...)
, just update it with c.target=(1,1,1)
.
Let me know if this works for you.
from pythreejs.
(You'll have to pull the latest master to get that commit, of course)
from pythreejs.
That works, thanks! I backported to a branch for IPython 3.1.0 and pushed it here: https://github.com/erdc-cm/pythreejs/tree/ipy3.1.0
from pythreejs.
Can you make a pull request?
from pythreejs.
@cekees - I think jasongrout@f06441d may make the master branch compatible with IPython 3.1. If you have time, can you check to see if master now works with IPython 3.1?
from pythreejs.
I am still not able to change camera angle from python. I have orbitcontroller and change its target position.
It works when orbitcontroller is not used.
Can anyone confirm it works or provide working example?
from pythreejs.
Related Issues (20)
- DirectionalLight on Google Colab HOT 13
- Javascript error when rendering with version 2.4.1 HOT 36
- Setting Bone Inverses HOT 1
- Right click on scene brings up Jupyter menu as well as translating the camera HOT 1
- Sprite not visible with orthographic camera HOT 1
- Issue with LineMaterial (and LineDashedMaterial)? HOT 2
- Automatic publicPath is not supported in this browser HOT 6
- Getting Error: No version of module jupyter-threejs is registered HOT 4
- Cannot import in ipython 8.4.0: AttributeError: 'TerminalInteractiveShell' object has no attribute 'kernel' HOT 1
- Javascript error when rendering HOT 2
- TypeError when using Vector3 class HOT 1
- Can not use in JupyterLite HOT 2
- Latest pip installation is not working HOT 1
- autoplay in exported html?
- bug in multiple object animation
- unclear error message
- Hi there is the Textgeometry implemented
- Texture Loader has no method load HOT 1
- Widgets not appearing when using nbsphinx or myst-nb HOT 1
- shipped wheels and PyPI tarballs fail npm audit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythreejs.