• Runtimes
  • [XNA/MonoGame] Rendering an animation in 3D space

  • Изменено
Related Discussions
...

Hi!
First I have to say I really like Spine. Thank you for an awesome software!

I'm trying to render a spine animation as a flat 2d image in 3D space. The problem is that I'm not terribly good at 3D yet. I've tried to modify the SkeletonMeshRenderer but it does not work, I cant see anything. (when rendering the animation as flat 2D on top of everything it works)

public void Begin (Matrix view, Matrix projection) {
   defaultBlendState = premultipliedAlpha ? BlendState.AlphaBlend : BlendState.NonPremultiplied;

   device.RasterizerState = rasterizerState;
   device.BlendState = defaultBlendState;

    effect.Projection = projection;
    effect.View = view;
    effect.World = Matrix.CreateTranslation(new Vector3(50, 50, 50)); //Hardcoded position
}

Can anything give me a push in the right direction? Should I use another method or modify code somewhere else?

I'm not super familiar with XNA APIs, but it seems like you are on the right track. My guess is you are drawing outside of the camera's view. You may also need to adjust near and far planes. Maybe try drawing a simple image with similar code. Once you get that simpler example working, then see about porting it into the skeleton rendering.