THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/01/2004 at 11:39, xxxxxxxx wrote:
Cinema 4D Version: 8.207
Platform: Windows ;
Language(s) : C++ ;
I'm trying to write an object plugin, that generates geometry according to its distance to the camera.
The problem is, that if the object is a virtual object
of a generator, the GetMg call seems to return only the local matrix and not the proper global matrix.
How can I determine the correct matrix?
I hope somebody can help me.
Thanks in advance.
On 11/01/2004 at 13:21, xxxxxxxx wrote:
works fine here.
On 12/01/2004 at 02:58, xxxxxxxx wrote:
ok, why does my generator (positioned at (0,0,0)) return an identity matrix if i link it in a instance object that is moved to (200,0,100) then?
it should return a global matrix with matrix.off = Vector(200,0,100), or do i mix up something here?
On 12/01/2004 at 06:32, xxxxxxxx wrote:
No, why should the global matrix be touched if your generator is linked to an instance object? Also the local matrix is not affected by this.
On 12/01/2004 at 08:33, xxxxxxxx wrote:
not the matrix of the original object, thats correct. but the instance object creates a copy of my generator in its cache, and this copy should return the above mentioned global matrix, and not the global matrix of the original object.
On 12/01/2004 at 08:38, xxxxxxxx wrote:
Well, I am not sure on what it depends but another question, why don´t you use the instance matrix?
On 12/01/2004 at 11:53, xxxxxxxx wrote:
Because I can't get it or at least I donot know how.
Cached objects donot have a GetUp() link, and GetCacheParent() returns something but not the instance object. So that's what my question was about, how do I get that matrix...
On 12/01/2004 at 12:19, xxxxxxxx wrote:
I don´t understand this really. If you can link the generator in an instance object you have to have a pointer to the instance object.
It would help if you´d post some code.
On 12/01/2004 at 14:25, xxxxxxxx wrote:
No, since the generator knows nothing about objects that link it. What I am doing is the following:
camdist = cam->GetMg().off - op->GetMg().off;
op->GetMg(); does NOT return the correct global matrix if it is in the cache of another generator;
On 12/01/2004 at 14:29, xxxxxxxx wrote:
In addition, I have no possibility of getting the generator's matrix since op does not have a GetUp() link if its cached. This behaviour is documented this way in the SDK, so I am not assuming this to be a bug. On the other hand I wonder how the cinema renderer determines the global matrix of cached objects. There has to be a way to do this, but it's neither documented nor obvious how.
On 12/01/2004 at 14:33, xxxxxxxx wrote:
The renderer does polygonize the complete scene when rendering afaik, so it shouldn´t be of any problem. Not sure why it´s not working with an instance object. Probably it uses a polygonized version of the input object too.
On 12/01/2004 at 14:37, xxxxxxxx wrote:
The generator code gets actually called, and maybe the object is polygonized afterwards, but that should be no problem. The correct generation of the geometry is (without knowing the correct global position of the generator object).
On 12/01/2004 at 14:39, xxxxxxxx wrote:
I have also tried searching the whole scene for links to my generator and to determine which object is the corresponding generator for my object, but this is awful and can fail badly. There must be a better way to do this.
On 12/05/2007 at 04:31, xxxxxxxx wrote:
do you find any way to get VirtualObjects Mg?