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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:15:18+00:00 2026-05-30T21:15:18+00:00

In this question I asked how to create a mirrored texture and now I

  • 0

In this question I asked how to create a “mirrored” texture and now I want to move this “mirrored” image down on the y-axis about the height of the image.
I tried something like this with different values of HEIGHT but I cannot find a proper solution:

// Vertex Shader
uniform highp mat4 u_modelViewMatrix;
uniform highp mat4 u_projectionMatrix;
attribute highp vec4 a_position;
attribute lowp vec4 a_color;
attribute highp vec2 a_texcoord;
varying lowp vec4 v_color;
varying highp vec2 v_texCoord;
void main()
{
    highp vec4 pos = a_position;
    pos.y = pos.y - HEIGHT;
    gl_Position = (u_projectionMatrix * u_modelViewMatrix) * pos;
    v_color = a_color;
v_texCoord = vec2(a_texcoord.x, 1.0 - a_texcoord.y);
}
  • 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-30T21:15:20+00:00Added an answer on May 30, 2026 at 9:15 pm

    What you are actually changing in your code snippet is the Y position of your vertices… this is most certainly not what you want to do.
    a_position is your model-space position; the coordinate system that is centered around your quad (I’m assuming you’re using a quad to display the texture).

    If instead you do the modification in screen-space, you will be able to move the image up and down etc… so change the gl_Position value:

    ((u_projectionMatrix * u_modelViewMatrix) * pos + Vec4(0,HEIGHT,0,0))
    

    Note that then you will be in screen-space; so check the dimensions of your viewport.

    Finally, a better way to achieve the effect you want to do is to use a rotation matrix to flip and tilt the image.
    You would then combine this matrix with the rotation of you image (combine it with the modelviewmatrix).

    You can choose to either multiply the model matrices by the view projection on the CPU:

    original_mdl_mat = ...;
    rotated_mdl_mat = Matrix.CreateTranslation(0, -image.Height, 0) * Matrix.CreateRotationY(180) * original_mdl_mat;
    mvm_original_mat = Projection * View * original_mdl_mat;
    mvm_rotated_mat = Projection * View * rotated_mdl_mat;
    

    or on the GPU:

    uniform highp mat4 u_model;
    uniform highp mat4 u_viewMatrix;
    uniform highp mat4 u_projectionMatrix;
    gl_Position = (u_projectionMatrix * u_model * u_viewMatrix) * pos;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question yesterday about storing a plot within an object. I tried
Krumelur asked this question about how create a recipient bubble similar to the mail.app.
I saw this question asked about C# I would like an answer for PHP.
The reason I asked this question is that I wanted to create a helper
Now this question looks similar to the question I've asked here , however, this
I know this question is asked many times but I just want to clear
This is in reference to the question asked at Create a Wordpress post with
I was asked this question in an interview today. When we create a thread
Anyone knows how to create one? I know this question has been asked before
This question is asked by one of my students and I want to enlighten

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.