Thanks Andy - that's great.
Cheers,
Alan.
On 7/18/05, Andrew Nicholas <andy(at)andynicholas.com> wrote:
> Hi Alan,
>
> I think I understand what you're wanting to do. You just want to transform
> the vertices of an object to the position and orientation of a particle,
> right? Kinda like parenting the object to the particle?
>
> I'm guessing you've already created a Matrix3 based on the XYZ rotation
> from the particle? I which case, you'll need to invert that matrix (since
> you effectively need to go from world to local) and use that to transform
> the mesh vertices into that particle's space. You can then just multiply
> the vertex position by the scale, and then add the particle position to
> the transformed vertex position. I think that should put it in the corrent
> place.
>
> It is possible to put this sequence of transforms into a single matrix,
> which would also be faster since you only have to do a single
> matrix-vector multiply. Like Kim said, you can get the transformation to
> occur in any order you like; it just depends on what order you concatenate
> the transformation matrices.
>
> Cheers
>
> Andy
>
>
> > Hi Andrew,
> >
> > I'm transforming a mesh (point by point) using the data on a particle.
> > So the rotation is a CVector3 as is the position and size is a double.
> >
> > So not looking to go between spaces - the origin of the meshes space
> > will be shifted to the particle's.
> >
> > Cheers,
> >
> > Alan.
> >
> > On 7/18/05, Andrew Nicholas <andy(at)andynicholas.com> wrote:
> >> Hi Alan,
> >>
> >> It depends on what you're doing. Could you give a bit more info? What is
> >> it that you are transforming i.e. a point, vector, normal, matrix, etc?
> >> Are you trying to go from local space to world, or the world to local
> >> using the inverse global matrix? Or are you just concatenating
> >> transforms?
> >>
> >>
> >>
> >> > Hi Andy,
> >> >
> >> > Thanks - most appreciated. I've been accessing it within a custom
> >> > parameter. Though I've got another vaguely related question.
> >> >
> >> > Does the matrix multiply operation rotate before translation?
> >> >
> >> > Cheers,
> >> >
> >> > Alan.
> >> >
> >> > On 7/18/05, Andrew Nicholas <andy(at)andynicholas.com> wrote:
> >> >> Hi Alan,
> >> >>
> >> >> You might want to check what class of object you're starting with by
> >> >> using
> >> >> the GetClassIDName() method. Sometimes you won't always have what you
> >> >> think you should have. I've been caught out a few times by this.
> >> >>
> >> >> The code below obtains the PolygonMesh object from a polymesh input
> >> >> connection of a SCOP:
> >> >>
> >> >>
> >> >> XSI::InputPort
> >> polyMeshPort(op.GetPort(L"polymshIn",L"Group_0",0));
> >> >> XSI::Primitive primitive(polyMeshPort.GetValue());
> >> >>
> >> >> //Get geometry object from primitive
> >> >> XSI::Geometry geometry(primitive.GetGeometry());
> >> >>
> >> >> //Check that the geometry is actually a polygon mesh
> >> >> if(!geometry.IsA(XSI::siPolygonMeshID)) return XSI::CStatus::Fail;
> >> >>
> >> >> //Create the polygon mesh object
> >> >> XSI::PolygonMesh polyMesh(geometry);
> >> >>
> >> >> Hope this helps.
> >> >>
> >> >> Cheers
> >> >>
> >> >> Andy
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> > When I run .IsA on a poly mesh it tells me it's an X3DObject - so I
> >> >> > try getting the activeprimitive of it and it tells me it's a
> >> >> > primitive.
> >> >> >
> >> >> > Any idea why I'm getting non-specific types? This is in C++
> >> >> >
> >> >> > CRef item = app.GetSelection().GetItem(0) ;
> >> >> > if (item.IsA(siPolygonMeshID) ) {
> >> >> > //nope it says it's not...
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > Alan.
> >> >> >
> >> >> > ---
> >> >> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text
> >> in
> >> >> body:
> >> >> > unsubscribe xsi
> >> >> >
> >> >>
> >> >> ---
> >> >> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> >> >> body:
> >> >> unsubscribe xsi
> >> >>
> >> >
> >> > ---
> >> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> >> body:
> >> > unsubscribe xsi
> >> >
> >>
> >> ---
> >> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> >> body:
> >> unsubscribe xsi
> >>
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> > unsubscribe xsi
> >
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi