Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
display obj file natively? #301508
12/11/09 08:27
12/11/09 08:27
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
I would like to run a script to display a .obj file while running the engine. I suppose I need an obj viewer if that's possible. confused
thanks


Black holes are where God divided by zero.
Re: display obj file natively? [Re: Nicholas] #301513
12/11/09 10:26
12/11/09 10:26
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
One way would be to read the .obj file and write it into the file system as .x file or .mdl file and open it with ent_create.

There are a lot of file format descriptions for .obj to find in the web. Check the manual for .mdl file description.

But there are some pitfalls... .mdl only supports triangles as geometry while there could be quads, n-gons and nurbs in your .obj file, along with other informations which may be unsupported by the engine (morph targets, weightmap references, ...)

Maybe you rethink if it is important to open .obj files directly, or if you should use MED, milkshape, etc. to convert the models into a supported file format.

Re: display obj file natively? [Re: slacer] #301557
12/11/09 17:04
12/11/09 17:04
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
The obj files I'll be working with will only be triangles with normal and texture defined. I didn't think you could use quads in obj.
I would think converting it to mdl would be best to load it in the engine, but how can I convert obj to mdl in the engine then load up the made file (loading the file will be easy, but how would I convert to mdl).
example:
Code:
# Wavefront OBJ

v 15.621928 0.331934 9.588501
v 35.975174 -37.208717 -30.229166
v -29.597080 14.876783 6.640664
# 3 vertices

vt 0.000000 1.000000
# 1 texture coordinates

vn 0.283950 0.765858 -0.576917
# 1 normals

g Triangles
s 1
f 1/1/1 2/1/1 3/1/1
# 1 triangles in group

# 1 triangles total



this is the structure of the obj I'll be working with, but I'll need to open (or convert it) in the engine.


Black holes are where God divided by zero.
Re: display obj file natively? [Re: Nicholas] #301649
12/12/09 14:04
12/12/09 14:04
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Well, it depends on the source of your .obj file.
While the file format description at wikipedia seems to be reduced to just triangles, you should know that wavefront was a complex thing.

Here is a more detailed format description:
http://www.fileformat.info/format/wavefrontobj/egff.htm

Instead of exporting the data as .mdl file, you could also create a dummy entity on the fly, retrieve its DirectX pointer and replace its geometry with your imported data.

The "higher languages" forum should be a good source for additional informations.


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