pythreejs | A Jupyter - Three.js bridge | Graphics library
kandi X-RAY | pythreejs Summary
kandi X-RAY | pythreejs Summary
A Python / ThreeJS bridge for Jupyter Widgets.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render Face3 .
- Render a sprite to an element .
- This function writes the javascript index .
- Serializes a uniform object .
- Create a list of modules that belong to .
- Draw a pattern
- Render a line to an element .
- Checks to see if the line intersects .
- write index files
- listen methods
pythreejs Key Features
pythreejs Examples and Code Snippets
Community Discussions
Trending Discussions on pythreejs
QUESTION
I am using pythreejs
to visualize some 3D models.
When visualizing the models on a Jupyter notebook, everything works as expected.
But when trying to embed the widget in an HTML document, I am facing two problems:
- It seems the camera, on load, is looking at (0, 0, 0), not as expected, and once you interact with the widget, the camera will "jump" and start looking at the expected coordinate
- The projection (ortographic camera mode) is lost too
Here is the code to reproduce the error and an animation of the mentioned problem:
...ANSWER
Answered 2020-Jan-09 at 19:40It took a few days, didn't get cadquery working properly, neither the code from your first question on this topic without cadquery The code here made it possible to look at the issue...
The jumping happens because orbit.update()
for target does not occurs and the function update()
is not available in python; only in c++ or c#, etc. From the docs:
When animating the camera rotation above, we used the camera’s quaternion . This is the most robust method for animating free-form rotations. For example, the animation above was created by first moving the camera manually, and then reading out its position and quaternion properties at the wanted views...
The text can be found here on page 12. And also discussed here at github.
However, the jumping can be reproduced in IPython if you apply the following:
renderer = Renderer(scene=scene, camera=camera, controls=[orbit], position=target, width=view_width, height=view_height)
here position
is added with target coordinates [0, 5, 0] but the update for this is only done when you mouse-click and adjust to position of the cube/camera. The jump is similar/equal to the jump as seen in the export.HTML.
Conclusion: the programmed camera position is seen as a jump after manual interference due to the absense of the .update()
function of the OrbitControls python class and thus not a bug or mistake.
Update 1 - Ipython Renderer output while not ran in jupyter-notebook:
QUESTION
I installed pythreejs following the instructions on the official website
...ANSWER
Answered 2020-Jan-07 at 22:03Looking more closely at jupyter's output in the console, I read:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pythreejs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page