🔒 Locked
mesh files
Advertisement
Original Post
when using a mesh.x file I am using directX8. Is it easier to use a mesh fileo in directX9 or planned future versions. It is cumbersome when rendering a mesh file as you need to load the bits every frame. Also I can use and display a mesh file but to be honest i dont understand what all the directX code means. it is easy enough to find the code which displays an object and other set-up code to make it work. DO I need to know about gritty details of how directX works or just being able to know enough to mmake it work and do what you want is enough.
I'm not sure what you are trying to ask. However, reloading the mesh file from disk every frame is neither necessary or good practice. It is bad. Bad! Load the mesh from file at initialisation time, and create appropriate structures to hold only the required data (vertices, faces, materials, textures). Then each frame render them without accessing the files.
If you want to use X files as the basis for a somewhat larger project, it might be useful to know about its internal file format. However, you could stick to the parts you need first and increase knowledge as you learn to use more features of the format.
Greetz,
Illco
If you want to use X files as the basis for a somewhat larger project, it might be useful to know about its internal file format. However, you could stick to the parts you need first and increase knowledge as you learn to use more features of the format.
Greetz,
Illco
Quote:
Original post by Illco
I'm not sure what you are trying to ask. However, reloading the mesh file from disk every frame is neither necessary or good practice. It is bad. Bad! Load the mesh from file at initialisation time, and create appropriate structures to hold only the required data (vertices, faces, materials, textures). Then each frame render them without accessing the files.
If you want to use X files as the basis for a somewhat larger project, it might be useful to know about its internal file format. However, you could stick to the parts you need first and increase knowledge as you learn to use more features of the format.
Greetz,
Illco
what about the frame rates with direct3D. How do you speed up the moving of a mesh file. I will check it but it looks like the image moves about 20 frames per second . This is the tutorial mesh program with SDK.
is direct3D slow?
Direct3D is as slow as you make it -- generally it is considerably fast. Which sample are you checking? Perhaps the sample demonstrates some technique that requires a lot of processing power and is bringing down the frame rate? Otherwise, which graphics card do you have and which drivers, do you use the DX debug runtime, do you use the REF device, etc. There may be many things that bring down framerate, you see. But for a simple mesh, 20FPS is really slow. There is some problem in the code, I think. Maybe give a short outline of your program?
Greetz,
Illco
Greetz,
Illco
Quote:
Original post by jagguy
what about the frame rates with direct3D. How do you speed up the moving of a mesh file. I will check it but it looks like the image moves about 20 frames per second . This is the tutorial mesh program with SDK.
is direct3D slow?
The tutorials are not optemised for speed and use the minimum of code to demonstate particular techniques.
For this particular tutorial (the Meshes tutorial) try adding the following line to the InitD3D function:
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
Add it after the line:
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
so that your InitD3D function looks like this:
HRESULT InitD3D( HWND hWnd ){ // Create the D3D object. if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) ) return E_FAIL; // Set up the structure used to create the D3DDevice. Since we are now // using more complex geometry, we will create a device with a zbuffer. D3DPRESENT_PARAMETERS d3dpp; ZeroMemory( &d3dpp, sizeof(d3dpp) ); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Create the D3DDevice if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice ) ) ) { return E_FAIL; } // Turn on the zbuffer g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE ); // Turn on ambient lighting g_pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0xffffffff ); return S_OK;}Before I added the line I had approx 40 frames per second.After adding the line I had approx 1090 frames per second!
Note: both measurements are with the window fully maximised, with a screen resolution of 1024 * 768.
Also I note this tutorial does not have code to measure the framerate, so I had to Add my own.Could you post code you added to measure the framerate?
HTH,
Cambo_frog
Original post by Cambo_frogQuote:
Original post by jagguy
what about the frame rates with direct3D. How do you speed up the moving of a mesh file. I will check it but it looks like the image moves about 20 frames per second . This is the tutorial mesh program with SDK.
HTH,
Cambo_frog
when searching for free graphic .x files, on internet I am getting X files as in the TV series (even with graphics/computer in the search). So what is a better way to search for the .x files
Quote:
Original post by jagguy
when searching for free graphic .x files, on internet I am getting X files as in the TV series (even with graphics/computer in the search). So what is a better way to search for the .x files
I don't think you will find many models in the .x file format. I usually find models in other formats (.3ds and .max format) and convert to x file format.
If I remember correctly the DirectX 8 SDK came with a utility for converting .3ds files to .xfiles. The utility is called conv3ds.exe or something similar, so search for it in your SDK folders.
I will find some free model sites and posts the links here.
***edit***
Here are a few links:
www.createandshare.com
www.3dcafe.com
www.help3d.com
www.turbosquid.com
HTH,
Cambo_frog
[Edited by - Cambo_frog on April 7, 2005 4:15:35 AM]
Quote:
Original post by Cambo_frog Quote:
Original post by jagguy
what about the frame rates with direct3D. How do you speed up the moving of a mesh file. I will check it but it looks like the image moves about 20 frames per second . This is the tutorial mesh program with SDK.
is direct3D slow?
The tutorials are not optemised for speed and use the minimum of code to demonstate particular techniques.
For this particular tutorial (the Meshes tutorial) try adding the following line to the InitD3D function:
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
Add it after the line:
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
so that your InitD3D function looks like this:
*** Source Snippet Removed ***
Before I added the line I had approx 40 frames per second.After adding the line I had approx 1090 frames per second!
Note: both measurements are with the window fully maximised, with a screen resolution of 1024 * 768.
Also I note this tutorial does not have code to measure the framerate, so I had to Add my own.Could you post code you added to measure the framerate?
HTH,
Cambo_frog
Hi
I have got directX8 and getting a little tired of it.
In SDK8 I used the
after the line suggested
d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_UNLIMITED;
d3dpp.FullScreen_PresentationInterval=D3DPRESENT_INTERVAL_DEFAULT(0);
and it didnt do anything 'no output screen at all but no error'. My software is win95,P233, 48mg...slow machine . I have a newer machine p4 with onboard graphics but again ...no output
how do I get the intellisense to pop-up when I do d3dpp.<list> as I dony get anything
Quote:
I have got directX8 and getting a little tired of it.
In SDK8 I used the
after the line suggested
d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_UNLIMITED;
d3dpp.FullScreen_PresentationInterval=D3DPRESENT_INTERVAL_DEFAULT(0);
and it didnt do anything 'no output screen at all but no error'. My software is win95,P233, 48mg...slow machine . I have a newer machine p4 with onboard graphics but again ...no output
Are you still using the Meshes tutorial? If so this tutorial doesn't support full screen mode (just windowed) so these settings would have no effect.The refresh rate would have no effect on the frame rate anyway, AFAIK it only affects your monitors refresh rate.
Did you try setting d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
as I mentioned earlier? Note: "PresentationInterval" and not "FullScreen_PresentationInterval".
Quote:
how do I get the intellisense to pop-up when I do d3dpp.<list> as I dony get anything
Sorry, I can't help you there as I am using a later version of the SDK, and I am using Visual Studio.Net 2003, and I assume you are using VC 6 if you are running Windows 95.
BTW, Click here if you want to see a screen shot of the Jumbo jet model I mention earlier (in MeshViewer).
Click here if you want to download the mesh as a zip file.
HTH,
Cambo_frog
[Edited by - Cambo_frog on April 7, 2005 5:32:51 AM]
Original post by Cambo_frogQuote:
Are you still using the Meshes tutorial? If so this tutorial doesn't support full screen mode (just windowed) so these settings would have no effect.The refresh rate would have no effect on the frame rate anyway, AFAIK it only affects your monitors refresh rate.
Did you try setting d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
as I mentioned earlier? Note: "PresentationInterval" and not "FullScreen_PresentationInterval".
HTH,
Cambo_frog
this line doesnt work in directX8. The ones I gave were for window-mode with parameter ..DEFAULT(0) which is for window-mode even though it says FullScreen....
Do I have a hardware or software problem? I cant display all of the SDK8 3D examples with my hardware
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
There is no .PresentationInterval variable in the struct, just .FullScreen_Present.......
I am just using the mesh tutorial in SDK8 and adding lines mentioned above
Your plane looks excellent
Original post by jagguyQuote:
Original post by Cambo_frog Quote:
Are you still using the Meshes tutorial? If so this tutorial doesn't support full screen mode (just windowed) so these settings would have no effect.The refresh rate would have no effect on the frame rate anyway, AFAIK it only affects your monitors refresh rate.
Did you try setting d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
as I mentioned earlier? Note: "PresentationInterval" and not "FullScreen_PresentationInterval".
HTH,
Cambo_frog
this line doesnt work in directX8. The ones I gave were for window-mode with parameter ..DEFAULT(0) which is for window-mode even though it says FullScreen....
Do I have a hardware or software problem? I cant display all of the SDK8 3D examples with my hardware
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
There is no .PresentationInterval variable in the struct, just .FullScreen_Present.......
I am just using the mesh tutorial in SDK8 and adding lines mentioned above
Your plane looks excellent
I can't really help you any further on this, as I don't have the 8 SDK. I didn't realize the D3DPRESENT_PARAMETERS structure had changed so mutch between version 8 and 9 of the SDK.Maybe someone who is using version 8 of the SDK can help you with this.
I did an edit of my last post to add a link to the jumbo x file, but in case you missed it then click here if you want to download it (zip file around 250k).
Good Luck,
Cambo_frog
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement