Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6028027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:40:42+00:00 2026-05-23T04:40:42+00:00

I have 2 types of objects, one is 2D and will only face directly

  • 0

I have 2 types of objects, one is 2D and will only face directly forward like a flat image, while the other will be 3D such that it scales and skews according to different rotations. So SpriteBatch.Begin applies the matrix to everything until I call End. I read somewhere that I should call Begin twice, once to draw the 2D sprites and once to draw the 3D objects but I don’t know how I would change the matrix to fit each 3D object’s needs and I’m very sad for not remembering what the link was.

So I wish to know how to do this without calling Begin and End on every object because that would be disastrous.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:40:42+00:00Added an answer on May 23, 2026 at 4:40 am

    The correct solution here is to not use SpriteBatch for 3D drawing. You should start using the actual 3D drawing API.

    SpriteBatch is merely a convenience layer over the top of the 3D API for 2D sprite drawing. You could, for example, write your own 3D version of SpriteBatch.

    Within SpriteBatch there is no way to specify more than one transformation matrix to each batch. So if you have to have multiple matrices, you have to have multiple batches (multiple begin/end blocks).

    If you’re really keen on the SpriteBatch-based solution, then it is possible to do it that way – so you could try it and see how the performance is.

    (You could also do a very ugly hack where you replace the vertex shader, somehow packing the 3D transformation data into each sprite, and then unpacking it in the shader. Ugly. Don’t do it. [Edit: also overriding the SpriteBatch vertex shader is very difficult XNA before 4.0])

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that has many different types of objects that each persist
I have a vector-like class that contains an array of objects of type T
Lets say you have various objects of arbitrary type that you would like to
We have developed one android application which will send the request and receive the
I have an array of different type objects and I use a BinaryWriter to
I have a method which returns an array of fixed type objects (let's say
I have a situation where two objects of the same type have parents of
I have a C# interface with certain method parameters declared as object types. However,
I have a helper assembly which includes a function to identify object types: namespace
I have IQueryable list of objects of type T which I want to transform

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.