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 7889379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:05:02+00:00 2026-06-03T06:05:02+00:00

I am having a problem when trying to rotate my particle system. First off,

  • 0

I am having a problem when trying to rotate my particle system. First off, I am not trying to rotate each particle to try and enhance an effect what I am trying to do is rotate the emitter position. so for example if i have an emitter position at 0,0,0 and I emit particles -5 and 5 on both the x and z axes I will end up with particles emitting in a square fashion that is in line with the world axes. What i want to is rotate this so that it emits exactly the same but rotated around the emitter point.

 // Each particle point is converted to a quad (two triangles)
[maxvertexcount(4)]  
void mainGSDraw
(
point VS_VertIn                  inParticle[1], // One particle in, as a point
inout TriangleStream<GS_VertOut> outStrip       // Triangle stream output, a quad containing two triangles
)
{
// Camera-space offsets for the four corners of the quad from the particle centre
// Will be scaled depending on distance of the particle
const float3 Corners[4] =
{
    float3(-1,  1, 0),
    float3( 1,  1, 0),
    float3(-1, -1, 0),
    float3( 1, -1, 0),
};

// Texture coordinates for the four corners of the generated quad
const float2 UVs[4] = 
{ 
    float2(0,1), 
    float2(1,1),
    float2(0,0),
    float2(1,0),
};

const float3x3 RotY = 
{ 

    cos(rotationAngle),0,sin(rotationAngle), 
    0,1,0,
    -sin(rotationAngle),0,cos(rotationAngle)
};
GS_VertOut outVert; // Used to build output vertices

// Output the four corner vertices of a quad centred on the particle position
[unroll]
for (int i = 0; i < 4; ++i)
{
    // Use the corners defined above and the inverse camera matrix to calculate each world
    // space corner of the quad

    float3 corner = Corners[i] * inParticle[0].Scale;   // scale first
    float3 worldPosition;


worldPosition = mul(inParticle[0].Position + mul( corner, (float3x3)InvViewMatrix), RotY) ;   // face the camera
    // Transform to 2D position and output along with an appropriate UV
    outVert.ViewportPosition = mul( float4(worldPosition, 1.0f), ViewProjMatrix );
    outVert.TexCoord = UVs[i];
    outStrip.Append( outVert );
}
outStrip.RestartStrip();

}
Above is the code for my geometry shader draw function, a particle as a point comes in and is expanded to a quad, scaled and then the world position is calculated. The rotation calculation is wrong if the particle system is at the origin it rotates the system exactly as i want it but as soon as I move it, it rotates around the origin so my question is how to do this rotation around the origin of the emitter not the world zero? The code has been cut down so no need for replies that this code might not work.

  • 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-06-03T06:05:04+00:00Added an answer on June 3, 2026 at 6:05 am

    You would multiple the translation of your particle from the emitter origin by the rotation, then add the translation of the emitter from the world origin.

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

Sidebar

Related Questions

Im having a problem when trying to create a member login system where each
I am having a problem when trying to use each() twice. I have a
I'm having a problem trying to position a div in my web page, here's
I am having a problem trying to use the prependTo() function in jQuery... for
I'm having a problem trying to format the output on the jQuery UI datepicker.
I'm having a problem trying to create a Javascript function that checks all the
I'm having a problem trying to make eclipse and aspectj work for Dynamic Web
I'm having a problem when trying to pass an array back to a COM
I am having problem that when i am trying to submit the form by
I'm having a pretty big problem trying to create navigation on my page. If

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.