Re: [CrystalSpace] #942: Multiplying the iMovable transform might break shaders
"CrystalSpace" <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.tracker |
|---|---|
| Message-ID | <[email protected]> |
#942: Multiplying the iMovable transform might break shaders
----------------------+-----------------------------------------------------
Reporter: weltall | Owner: res
Type: defect | Status: new
Priority: major | Milestone:
Component: renderer | Version: V2.1
Keywords: |
----------------------+-----------------------------------------------------
Description changed by weltall:
Old description:
> we are attempting, under suggestion from jorrit, to resize meshes by
> using the imovable transform instead of a cloned factory (which seems to
> not work correctly with sprcal3d)
> this is what we do:
>
> {{{
> csRef<iMovable> movable = mesh->GetMovable();
> csReversibleTransform & trans = movable->GetTransform();
> csRef<iSpriteCal3DFactoryState> sprite =
> scfQueryInterface<iSpriteCal3DFactoryState>
> (mesh->GetFactory()->GetMeshObjectFactory());
> scale = scale/sprite->GetScaleFactor();
> trans.SetO2T(trans.GetO2T() * scale);
> movable->UpdateMove();
> }}}
>
> (getscalefactor is an additional api added to sprcal3d interface which
> returns the current scale factor of the mesh, it doesn't really matter.
> It seems to make the issue show the resulting size from the transform
> should be higher than the original size of the factor, else, if it's
> lower, it seems to not happen at first look)
> [[Image(http://img850.imageshack.us/img850/252/shot897.png)]]
> if you see the one labeled ulbernaut is the original size, maulberlord is
> lower in size and looks ok, vilenaut is bigger in size and exposes the
> problem.
New description:
we are attempting, under suggestion from jorrit, to resize meshes by using
the imovable transform instead of a cloned factory (which seems to not
work correctly with sprcal3d)
this is what we do:
{{{
csRef<iMovable> movable = mesh->GetMovable();
csReversibleTransform & trans = movable->GetTransform();
csRef<iSpriteCal3DFactoryState> sprite =
scfQueryInterface<iSpriteCal3DFactoryState>
(mesh->GetFactory()->GetMeshObjectFactory());
scale = scale/sprite->GetScaleFactor();
trans.SetO2T(trans.GetO2T() * scale);
movable->UpdateMove();
}}}
(getscalefactor is an additional api added to sprcal3d interface which
returns the current scale factor of the mesh, it doesn't really matter.)
It seems to make the issue show the resulting size from the transform
should be higher than the original size of the factory, else, if it's
lower, it seems to not happen at first look)
[[Image(http://img850.imageshack.us/img850/252/shot897.png)]]
if you see the one labeled ulbernaut is the original size, maulberlord is
lower in size and looks ok, vilenaut is bigger in size and exposes the
problem.
--
--
Ticket URL: <http://www.crystalspace3d.org/trac/CS/ticket/942#comment:2>
CrystalSpace <http://www.crystalspace3d.org/>
Free open-source 3D SDK.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d