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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:27:50+00:00 2026-05-14T04:27:50+00:00

I am reading a open source project, and I found there is a function

  • 0

I am reading a open source project, and I found there is a function which read 3D data(let’s say a character) from obj file, and draw it .
the source code:

List<Vertex3f> verts=new List<Vertex3f>();
List<Vertex3f> norms=new List<Vertex3f>();
Groups=new List<ToothGroup>();
//ArrayList ALf=new ArrayList();//faces always part of a group
List<Face> faces=new List<Face>();
MemoryStream stream=new MemoryStream(buffer);
using(StreamReader sr = new StreamReader(stream)){
    String line;
    Vertex3f vertex;
    string[] items;
    string[] subitems;
    Face face;
    ToothGroup group=null;
    while((line = sr.ReadLine()) != null) {
        if(line.StartsWith("#")//comment
            || line.StartsWith("mtllib")//material library.  We build our own.
            || line.StartsWith("usemtl")//use material
            || line.StartsWith("o")) {//object. There's only one object 
            continue;
        }
        if(line.StartsWith("v ")) {//vertex
            items=line.Split(new char[] { ' ' });
            vertex=new Vertex3f();//float[3];
            if(flipHorizontally) {
                vertex.X=-Convert.ToSingle(items[1],CultureInfo.InvariantCulture);
            }
            else {
                vertex.X=Convert.ToSingle(items[1],CultureInfo.InvariantCulture);
            }
            vertex.Y=Convert.ToSingle(items[2],CultureInfo.InvariantCulture);
            vertex.Z=Convert.ToSingle(items[3],CultureInfo.InvariantCulture);
            verts.Add(vertex);
            continue;
        }

And why it need to read the data manually in directX? As far as I know, in XDA programming, we just need to call a function a load the resource.

Is this because it is in DirectX, there is no function to read resource?
If yes, then how to prepare the 3D resource ? in XDA we just need to use other software draw the 3D picture and then export. but what should I do in DirectX?

  • 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-14T04:27:50+00:00Added an answer on May 14, 2026 at 4:27 am

    The code above is for loading a SPECIFIC file format. Its not one that is supported. XNA allows loading of .X and FBX files. DirectX supports loading .X files but .FBX files have to be built using the FBX SDK.

    To render a .FBX using the DXSDK load up the SDK and transfer all the information to a relevant set of hardware data structure 🙂

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

Sidebar

Related Questions

I`m reading the code of some open source project. I see that in one
I'm reading through a open source Rails project code and I see SQL statements
hello all i have code from open source project that im integrating into my
I'm reading the source code of an open-source project and I've encountered the following
In an Open Source program I wrote , I'm reading binary data (written by
There are several Ruby open-source libraries for reading Microsoft Excel files, such as roo
I've been reading about Python's urllib2's ability to open and read directories that are
I have always wanted to participate in an Open Source project but once I
I am a vc++ developer (but like Qt) interested in learning from open source
I am using the SharpZipLib open source .net library from www.icsharpcode.net My goal is

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.