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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:02:08+00:00 2026-05-27T20:02:08+00:00

When I load an .obj file in GMax it is positioned in the center

  • 0

When I load an .obj file in GMax it is positioned in the center of the space (0,0,0).
How can I change this position? Is there any special function?

I don’t want to use glTranslatef. Rather I would like the whole pModel to move (the pModel structure to change). I found the function glmScale. Is there anything similar for translating or rotating?

When I load the obj I do smth like this:

pModelScaun=glmReadOBJ(filename);   
glmUnitize(pModelScaun);
glmFacetNormals(pModelScaun);
glmVertexNormals(pModelScaun,90.0);

and then I use the triangle to determine the light position and the shadow frascum

for (unsigned int i = 0; i < pModelScaun->numtriangles; i++)
{
    //compute the light vector (between the center of the current 
    //triangle and the position of the light (converted to object space)
    for (unsigned int j = 0; j < 3; j++)
    {
        fvIncidentLightDir[j] = (pModelScaun->vertices[3*pModelScaun->triangles[i].vindices[0]+j] +
                                pModelScaun->vertices[3*pModelScaun->triangles[i].vindices[1]+j] +
                                pModelScaun->vertices[3*pModelScaun->triangles[i].vindices[2]+j]) / 3.0 - lp[j];            
    }

Can you point me a way in which I could use the transformation matrices in this situation?

  • 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-27T20:02:09+00:00Added an answer on May 27, 2026 at 8:02 pm

    Since you have are using the vertices in object-space, and have transformed the light into their object-space, you can multiply the fvIncidentLightDir by your object’s transformation matrix to transform it back into world space.

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

Sidebar

Related Questions

I'm getting this error: File C:\Python26\lib\pickle.py, line 1374, in loads return Unpickler(file).load() File C:\Python26\lib\pickle.py,
In the below code how can i make it load the file into a
I have a problem to load more than one file. Obj in OpenGL. I
Hey all. I'm really new at this obj-c/xcode stuff. I'm trying to load the
Is there a standard way to load, read and parse an XML file from
i load a class using Class.forName(klassname,false,loader) After this i create an instance using klass.newInstance();
So I created the following file (testlib.py) to automatically load all doctests (throughout my
Using javascript, how to open a text-file or html-file from a web-page and load
I'm attempting to compile code in a text file to change a value in
I have this JSON in a file: { "maps": [ { "id": "blabla", "iscategorical":

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.