From: Fred B. <fl...@ys...> - 2006-02-26 03:21:37
|
I was going to replace my own ray tracing code, to use GeomRay and collide, but I'm not sure how to get the GeomRay positioned and oriented. I wrote some simple code to create a matrix to orient the ray, but then when I go to position it: File "ccluster.py", line 511, in trace_root ray.setPosition(pstart) File "geomobject.pyx", line 135, in ode.GeomObject.setPosition ValueError: Cannot set a position on non-placeable geoms. ? What _should_ I be doing? |
From: Chris B. <chr...@gm...> - 2006-02-26 10:41:31
|
On 26/02/06, Fred Burton <fl...@ys...> wrote: > File "ccluster.py", line 511, in trace_root > ray.setPosition(pstart) > File "geomobject.pyx", line 135, in ode.GeomObject.setPosition > ValueError: Cannot set a position on non-placeable geoms. > > ? > > What _should_ I be doing? According to the ode manual you should be using GeomRay.set(px,py,pz,dx,dy,dz) to set the position and direction. |
From: Chris B. <chr...@gm...> - 2006-02-27 10:50:21
|
On 27/02/06, Fred Burton <fl...@ys...> wrote: > > > According to the ode manual you should be using > > GeomRay.set(px,py,pz,dx,dy,dz) to set the position and direction. > > > > Hmm... > > ray.set takes two parameters > > (or some such) > > I've tried ray.set((px,py,pz,dx,dy,dz)) ... Use the source, Luke: (in geoms.pyx) cdef class GeomRay(GeomObject): ... def set(self, p, u): dGeomRaySet(self.gid, p[0],p[1],p[2], u[0],u[1],u[2]) ie. set() takes a pair of tuples (or lists), and calls dGeomRaySet with the contents. |