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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:51:20+00:00 2026-05-27T09:51:20+00:00

I have a file that defines a 3D model’s vertexes, normals, and connectivity information.

  • 0

I have a file that defines a 3D model’s vertexes, normals, and connectivity information.

Sample:

v -2.491060 -2.491060 0.000000
v 2.491060 -2.491060 0.000000
v -2.491060 2.491060 0.000000
v 2.491060 2.491060 0.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 1.000000 1.000000
f 1/1 2/2 3/3
f 3/3 2/2 4/1

Where:

v          vertex coordinate (x, y, z position)
vt        texture coordinate (u, v coordinate)
f          polygon connectivity information with vertex and texture indices

What would be the best way to read in and store this information? A custom class / struct that has an internal array of each vertex and connectivity information? I think I’ve once before read in data in a delimited fashion with C++, but it was of the same data type, so I chucked it into a multidimensional array. Should I just use stringstreams and a custom struct / class maybe?

EDIT Disclosure, this is for my 3D Graphics class, but I’m just seeking advisement here, not a fully written project, etc.

  • 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-27T09:51:20+00:00Added an answer on May 27, 2026 at 9:51 am

    First there’s one fact, you have to store them in dynamic arrays. As I know, wavefront doesn’t hold any information about how many vertices there are in a 3D-Obj file. Same for vertexnormals, texturecoordinates and faces.

    So I would tend to read them (vertices,normals,etc.) into structs and delete them after defining your triangles. Stringstreams and custom structs sounds good to me, so you are able to use regular expressions for reading out the necessary vertex/face data.

    I’m java-programmer (not too long), so sorry if I’m wrong :/

    This is perhaps a little bit complicated version of my .obj loader in my project: https://github.com/Chrise55/Llama3D/blob/master/src/llama/zoo1/llgeometry/LLLoadGeometry.java
    It’s java, but maybe it could help you? :/

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

Sidebar

Related Questions

I have a file that defines constant variables, like this: define_vars.php <? define(something,value); define(something1,value);
I have defined the following ApplicationManifest file the problem is that i have created
I have a file that contain huge number of net names. I would like
I have a file that I set using PowerShell that contains the version number
I have a file that contains: foo1 = 1 foo2 = 2 foo3 =
I have a file that stores exam scores for a class of students. I
I have a file that contains the following in a csv file; country,region,city,postalCode,metroCode,areaCode I
I have a file that contain lines that looks like this: >AF001546_1 [88 -
I have Text file that contains data separated with a comma , . How
I have a file that is similar to this: <many lines of stuff> SUMMARY:

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.