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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:05:42+00:00 2026-05-24T19:05:42+00:00

I am converting some code from HSLSL and XNA to CG and OpenGL. The

  • 0

I am converting some code from HSLSL and XNA to CG and OpenGL.

The code is for rendering volume data. But volume data is not also sampled using the same distance in each dimension, for example (0.9f, 1f, 1f). So a scale factor need to be applied.

In the XNA and HLSL example, they do the following:

mul(input.Position * ScaleFactor, WorldViewProj);

Where WorldViewProj is passed into the shader.

In OpenGL, I was under the impression that glstate.matrix.mvp was ModelViewProjection, where ModelView is World * View. Clearly I am wrong as when I do the following, nothing is drawn.

output.Position = mul( input.Position * scale, glstate.matrix.mvp);

The volume is been rendered with glMatrixMode set to GL_MODELVIEW. Will I have to create my own matrices? If so, any good tutorials? 😀

  • 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-24T19:05:43+00:00Added an answer on May 24, 2026 at 7:05 pm

    The volume is been rendered with glMatrixMode set to GL_MODELVIEW. Will I have to create my own matrices? If so, any good tutorials? 😀

    glMatrixMode is kind of like a with statement for the other matrix manipulation functions. So

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glTranslate(...);
    

    is to be interpreted like

    modelview_matrix.load_identity();
    modelview_matrix.translate(...);
    

    and so on.

    Furthermore see the answer of @Tobias Schlegel. Shaders get their “constant” input in form of so called Uniforms. Older versions of OpenGL pass on the fixed function state, like the modelview matrix. Newer OpenGL versions (OpenGL-3 core and later) depreceated all the built in matrix manipulation stuff. Instead the user is expected to keep track of the transformation piple and to supply all required matrices through self defined uniforms. This also allows to emulate the DirectX behaviour.

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

Sidebar

Related Questions

I am converting some Java code to C#. This code is using getGlyphOutline from
I'm using mootools 1.4.3 for basic class inheritance. I'm actually converting some code from
I'm a C# programmer but am converting some code from C# to VB.NET. In
I am manually converting code from Java (1.6) to C# and finding some difficulty
I am in the process of converting some code from C# to Java. I
I'm converting some c code to python. Can someone convert this for loop from
I'm converting some data in SQL Server: INSERT INTO MYTABLE (AllowEdit) (Select PreventEdit from
I am having trouble converting some code from VB6 to VB.NET (I don't have
I'm converting some html parsing code from BeautifulSoup to lxml. I'm trying to figure
I have been converting some code from C++ to C#. My lack of understanding

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.