Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: export all entities to obj [Re: Dooley] #459894
06/10/16 09:45
06/10/16 09:45
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
The big limitation in my script is that it can only export the specific model. It actually exports a few different models, but they are all based on the same mesh, so they have the same triangle arrangements and number of vertices...

But it does do the thing you are looking for, it combines them all into one large mesh.

Re: export all entities to obj [Re: Dooley] #459896
06/10/16 11:21
06/10/16 11:21
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Originally Posted By: Dooley
The big limitation in my script is that it can only export the specific model. It actually exports a few different models, but they are all based on the same mesh, so they have the same triangle arrangements and number of vertices...

But it does do the thing you are looking for, it combines them all into one large mesh.
, that is indeed a big limitation. But perhaps I can learn from your posted code so I can fine tune the obj export code.
So tnx for uploading, it will take some time to let it all sink though. grin

Re: export all entities to obj [Re: Reconnoiter] #459913
06/11/16 20:06
06/11/16 20:06
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
Yes, my segments are very small, with around 25 vertices. Doing something like this with more complex meshes would get really messy, considering the number of triangles you would have to manually input.

Re: export all entities to obj [Re: Dooley] #459948
06/12/16 22:51
06/12/16 22:51

M
Malice
Unregistered
Malice
Unregistered
M



Hi,
I know I'm just jumping in here a bit under-informed.

However, D3D 9 haves it's own ability to take a 3d entity running in it's dx framework and save it as a X(file). Why not save the entity as a X and convert it off-side to obj?

DX9 D3d link https://msdn.microsoft.com/en-us/library/windows/desktop/bb205428(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb205428(v=vs.85).aspx

Last edited by Malice; 06/12/16 22:52.
Re: export all entities to obj [Re: ] #459952
06/13/16 00:05
06/13/16 00:05
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
Nice! Sounds complicated laugh

Re: export all entities to obj [Re: Dooley] #459953
06/13/16 01:45
06/13/16 01:45

M
Malice
Unregistered
Malice
Unregistered
M



TOP EDIT -> Finally read the whole thread. Sorry my posts don't really go on topic and add value to the thread. I see the export problem was solved it's just materials at issue. Also what I provided below helps these problem in no way. Sorry


Well I'd have to try it first to tell you, but steps( in my thinking)

1)run http://www.conitec.net/beta/ent_mesh.htm
an get mesh //-> Might need to grab the material separate


2)run this command Same MS DX9 link from the above post

3)exit engine

4)open converter

5)convert saved X file to OBJ(or other format)?

or vice-versa

EDIT -> Well it's taking me away from other things but... The function is in the d3dx9.h. It's commented out(I don't know why), so if you try to run it you get a error. Un-commenting fixes one error only to lead to another about a syntex error.Fixing that one lead me to another syntex error. fixing the second lead me to a third syntex error...

It's there in dx9 and partly there in the engine, but I've no idea how to get it up and running. If I did your code would look like thtis.


Code:
#include <acknex.h>
#include <default.c>
#include <d3d9.h>

function main()
{
	// ..... The basic sart to main here

	ent_dBox=ent_create("grass.mdl", vector(0,0,25),NULL);
		
		if(key_g)
		{
			while(key_g)
			wait(1);
			
			ID3DXMesh*    m_pMesh;           // Mesh object to be saved to a .x file
			D3DXMATERIAL* m_pMaterials;      // Array of material structs in the mesh
			DWORD         m_dwNumMaterials;  // Number of material structs in the mesh
			
			DWORD dwFormat = 1;  // Binary-format .x file (default)
			// MALICE COMMENTED// DWORD dwFormat = D3DXF_FILEFORMAT_TEXT; // Text-format .x file
			
			// Load mesh into m_pMesh and determine values of m_pMaterials and 
			// m_dwNumMaterials with calls to D3DXLoadMeshxxx or other D3DX functions
			
			// ...
			m_pMesh=ent_getmesh(ent_dBox,0,0);
			D3DXSaveMeshToX(
			L"outputxfilename.x",
			m_pMesh,
			NULL,
			m_pMaterials,
			NULL,
			m_dwNumMaterials,
			dwFormat );
			
		}
		wait(1);
	}
}



That's kind of simple really... if it worked at all

Last edited by Malice; 06/13/16 04:13.
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1