question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It seems that camera is not updated when viewup is modified but camera position is not changed:

import k3d
import numpy as np
from numpy import sin,cos,pi
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
import time
import math

plot = k3d.plot()

plot.camera_auto_fit = False

T = 1.618033988749895
r = 4.77
zmin,zmax = -r,r
xmin,xmax = -r,r
ymin,ymax = -r,r
Nx,Ny,Nz = 77,77,77

x = np.linspace(xmin,xmax,Nx)
y = np.linspace(ymin,ymax,Ny)
z = np.linspace(zmin,zmax,Nz)
x,y,z = np.meshgrid(x,y,z,indexing='ij')
p = 2 - (cos(x + T*y) + cos(x - T*y) + cos(y + T*z) + cos(y - T*z) + cos(z - T*x) + cos(z + T*x))
iso = k3d.marching_cubes(p.astype(np.float32),xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, zmin=zmin, zmax=zmax, level=0.0)
plot += iso

plot.display()

this doesnt work:

@interact(rad=widgets.FloatSlider(value=0,min=0,max=1,step=0.01))
def g(rad):
    plot.camera = [8,0,8,
                   0,0,0,
                   0,1-rad,rad]

while this works:

@interact(rad=widgets.FloatSlider(value=0,min=0,max=1,step=0.01))
def g(rad):
    plot.camera = [8,0,8+rad/100,
                   0,0,0,
                   0,1-rad,rad]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
artur-trzesiokcommented, Oct 22, 2019

Nice spot! This is a issue in ThreeJs: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js#L357

ThreeJs emite change event only if position change. They ignore a up vector. You can add them a issue.

0reactions
marcinofuluscommented, Nov 4, 2019

check for jupyter --paths: - perhaps you have k3d installed in a multiple locations e.g both in system and user space. Also have a look at jupyter nbextension list. It is possible that you will have to delete some location if there are doubled.

In principle, if jupyter notebook is running kernel from some different env - then I use --user for nbextensions (like central jupyterhub installations)

Read more comments on GitHub >

github_iconTop Results From Across the Web

This tiny camera can show the world from a bug's point of view
This tiny camera can show the world from a bug's point of view. Steerable arm helps save energy while capturing panoramic views.
Read more >
Camera Bug is a small but smart solution to a big but common ...
The Camera Bug, in contrast, is designed so that your hand and finger are always where they should be, right over the grip...
Read more >
Bugs flying around at night are setting it off my security ...
Anything that changes in the image will be picked up as motion. Unfortunately, insects are attracted to infrared light and will fly in...
Read more >
How to Keep Spiders, Bugs, and Insects Off Security Cameras
Disable the LED lights. Bugs are attracted to the LED lighting around your camera lens. If your camera allows, turn it off. Loop...
Read more >
Flying Bugs on your Night Vision Camera? Here's How to Stop ...
If you've noticed bugs swarming your security camera, there's a very probable chance that the light emitted by your camera is attracting insects...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found