Jump to content

How do you load a 3D model using SharpDX

grimreeper132

I am currently trying to learn how to use SharpDX and I am having issues on working out how to load 3D models into this, how do you do this??? Thanks

(I'm using C#)

The owner of "too many" computers, called

The Lord of all Toasters (1920X 1080ti 32GB)

The Toasted Controller (i5 4670, R9 380, 24GB)

The Semi Portable Toastie machine (i7 3612QM (was an i3) intel HD 4000 16GB)'

Bread and Butter Pudding (i7 7700HQ, 1050ti, 16GB)

Pinoutbutter Sandwhich (raspberry pi 3 B)

The Portable Slice of Bread (N270, HAHAHA, 2GB)

Muffinator (C2D E6600, Geforce 8400, 6GB, 8X2TB HDD)

Toastbuster (WIP, should be cool)

loaf and let dough (A printer that doesn't print black ink)

The Cheese Toastie (C2D (of some sort), GTX 760, 3GB, win XP gaming machine)

The Toaster (C2D, intel HD, 4GB, 2X1TB NAS)

Matter of Loaf and death (some old shitty AMD laptop)

windybread (4X E5470, intel HD, 32GB ECC) (use coming soon, maybe)

And more, several more

Link to comment
Share on other sites

Link to post
Share on other sites

I haven't used sharpDX but with any rendering API you will need to store the vertex data in a vertex buffer. So essentially you need to declare your buffer usage and the structure of the buffer and then load the buffer with your vertex data that you parse from your 3D model file.

 

From there it is making sure the input assembler knows how to use the data. Then developing your shaders and rendering to your render target amd presenting it to the screen.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

On 8/10/2019 at 3:13 PM, grimreeper132 said:

I am currently trying to learn how to use SharpDX and I am having issues on working out how to load 3D models into this, how do you do this??? Thanks

(I'm using C#)

Which format you are trying to load. Each has to be coded separately. The whole process is quite simple.

step 1 : load the file in memory

step 2 : read the format and load up the brep/triangles

step 3 : if it support textures, load up textures and texture coordinates

step 4 : redraw the scene in a loop by drawing your triangles.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×