Vpython 'compound' object - newbie still plugging away - Lightbulb Moment!

Found this link which goes some way to answering the issue.
I’m using Python 3.12.1 and vpython 7.6.4
[Getting error when compounding two objects (google.com)]

Looking at the threads I’m thinking my versions don’t work together well…
Maybe my best route forward is to change over to Processing 4 for animations?

From my previous post on this topic, I have started using VScode and gone through how to use the debugger examples.
I’ve also read up (using Google) on what the error code :
-line 3262, in handle_event obj._axis.value = obj._size._x*norm(obj._axis)
TypeError: unsupported operand type(s) for *: ‘float’ and ‘vpython.cyvector.vector’

…could possibly mean…???

So…I’ve got this far

  1. using the VScode debugger I noticed BNO055 = box was type (constant) BNO055 : box, where myBoard = box and nanoBoard = box were both type (variable) myBoard : box and (variable) nanoBoard : box.
    So I changed BNO055 to bnoBoard and now I have type (variable) bnoBoard : box.
  2. From what I read about the error issue my limited understanding is that I think I’m trying to compound vector objects together that have variables of type float and this is causing issues?
  3. Next I changed the vector values for size and pos to integer whole numbers but the error still remains and kills the process at myObj = compound([myBoard, bnoBoard,nanoBoard])

Looking for anymore help, advice, tips, guidance on this issue as I really need to get this working :thinking:

The object of the code is to rotate the boxes and arrows together, leaving the fixed axis arrows in place. If I comment out the ‘compound’ function I get the arrows rotating but not the boxes??
Here is my present code:

from vpython import *
from time import *
from math import *
import numpy as np
myArrowX = arrow(axis=vector(1,0,0), size=vector(2,0,0), shaftwidth=0.1, color=color.red)
myArrowY = arrow(axis=vector(0,1,0), size=vector(2,0,0), shaftwidth=0.1, color=color.green)
myArrowZ = arrow(axis=vector(0,0,1), size=vector(2,0,0), shaftwidth=0.1, color=color.blue)

#size = vector(length, height, width)
myBoard = box (size=vector(6,1,2), pos=vector(0,0,0), opacity = 0.5)
#myBoard = box (size=vector(6,0.2,2), pos=vector(0,0,0), opacity = 0.5)
bnoBoard = box (size=vector(1,1,1), pos=vector(2,1,0), opacity = 0.8, color=color.blue)
#bnoBoard = box (size=vector(1,0.15,0.8), pos=vector(2,0.175,0), opacity = 0.8, color=color.blue)
#BNO055 = box (size=vector(1,0.15,0.8), pos=vector(2,0.175,0), opacity = 0.8, color=color.blue)
nanoBoard = box (size=vector(2,1,1), pos=vector(-2,1,0), opacity = 0.8, color=color.green)
#nanoBoard = box (size=vector(2,0.15,0.6), pos=vector(-2,0.175,0), opacity = 0.8, color=color.green)

frontArrow=arrow(axis=vector(1,0,0), size=vector(4,0,0), shaftwidth=0.1, color=color.white, round=True)
upArrow=arrow(axis=vector(0,1,0), size=vector(4,0,0), shaftwidth=0.1, color=color.magenta, round=True) 
sideArrow=arrow(axis=vector(0,0,1), size=vector(4,0,0), shaftwidth=0.1, color=color.orange, round=True)

myObj = compound([myBoard,bnoBoard,nanoBoard])
while (True):
    for yaw in np.arange(0, 2*np.pi, .01):

        # x=cos(psi)cos(theta) y=1sin(theta) z=sin(psi)cos(theta)
        #yaw is angle psi, pitch is angle theta
        k=vector(cos(yaw)*cos(pitch), sin(pitch), sin(yaw)*cos(pitch))
        s=cross(k,y) #cross product k vector with y vector
        v=cross(s,k) #cross product s vector with k vector

        #took me a while to work this out from the lesson example on changing the arrow length


If you are talking about the same underlying problem which you are “still plugging away” at, it will be easier to keep the posts in the same thread. That way everyone can more easily see what you are referring to.