2

I'm showing some strange discrepancies between my declared camera position (scene.camera.pos), and the actual camera position. I can't believe this feature is just broken, am I missing something here?

Here's the code, and the output shown below

 GlowScript 3.1 VPython

cube = box(pos=vector(0, 0, 0), size=vector(1,1,1), color=color.red, texture=textures.rough)

scene.lights = [distant_light(direction=vector(0.4226, 0, -0.9063),color=color.gray(0.7)),distant_light(direction=vector(0.4226, 0, -0.9063),color=color.gray(0.7))]
scene.background = color.gray(0.8)
scene.camera.pos = vector(3,3,-3)
scene.camera.axis = cube.pos - scene.camera.pos
#scene.forward=cube.pos
#scene.camera.center=cube.pos
#scene.camera.fov = (pi/180)*10
#scene.camera.axis = vector(0, 0, 0)
#scene.up = vector(0,1,0)

while True:
    rate(0.5)
    scene.append_to_title(scene.camera.pos)
    #scene.camera.rotate(angle=0.05, axis=vec(0,0,1), origin=vec(0,10,0))
    #scene.capture("woah")

enter image description here

2 Answers2

1

I think I see the problem. There is a conflict between you manipulating the camera and the default scene.autoscale = True. If you set scene.autoscale = False before manipulating the camera, I think you'll find that the program behaves as expected. At the very least, this implies a need for the camera documentation to point out this conflict.

user1114907
  • 972
  • 8
  • 15
0

Finally checked back in on this and it's working properly now.

  • 1
    Yes, I just fixed this a couple days ago. Thanks again for pointing out the problem. The problem was that setting scene.camera.pos/axis fought with autoscaling, but now setting them sets scene.autoscale = False. – user1114907 Jul 27 '21 at 23:42