Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi , i have coppercube 6.6 , and I get this code // get the position of the first object var pos1 = coppercube.getSceneNodeFromName("Object1").getPosition(); // get the position of the second object var pos2 = coppercube.getSceneNodeFromName("Object2").getPosition(); // calculate the midpoint between the two objects var midpoint = new CL3D.Vect3d((pos1.X + pos2.X) / 2, (pos1.Y + pos2.Y) / 2, (pos1.Z + pos2.Z) / 2); I just wanna know how to apply it on a camera object. |
||||
|
don't know what kind of class you use but here same code
|
||||
|
Thanks but , what do you mean by "which class ?" |
||||
|
@Manomeno, the code you presented is not CopperCube API commands conform thus will not be understood by CC JavaScript compiler/interpreter while @SamGrady's version looks like it does fullfil that requirement CopperCube's JavaScript reference about valid syntax commands can be found at CC's documentation pages Tried Ai? |
||||
|
Ok ,Thanks a lot |
||||
|
its telling me script:5:ReferenceError: ccbGetActiveCamera is not defined how can i fix that? |
||||
|
strange thing cuz this code work even without camera node... |
||||
|
So yo mean that I can remove the camera node? |
||||
|
|