Widget request: Extract model data
Moderator: Moderators
Re: Widget request: Extract model data
I'm not bright enough to see what difference it makes to wireframes, please enlighten me.
Re: Widget request: Extract model data
Check what a 3DO wireframe looks like, and then view a S3O one in Spring. Return enlightened.
Re: Widget request: Extract model data
Ah, I guess you mean the diagonals, thanks.
Re: Widget request: Extract model data
And that's just the tip of the iceberg. Having a S3O parser, either engine-side or Lua, is a Big Deal.
Re: Widget request: Extract model data
@det
How am I insulting people by calling 1 person "not so incredibly dense"? Thats actually what I would consider a compliment. Im pointing out something good about him.
@others:
You guys really dont get it. Ill use big text so you can read it better:
I dont care about drawing. I dont want to know how to draw a wireframe. I dont want to know how to do what you want to know how to do. I dont want to convert to quads. I dont want to do anything except for this: Extract a list of vertices from a model, and extract a list of lines I could use to connect those vertices.
I have learned from Argh, who is a really great guy (no really), that this can only be done right now by parsing the s3o file. Has anyone done anything on this?
Aside from this, does anyone have a way of extracting this data from a file outside of spring? I dont care about the 3d model format or the programming language or what. I need a list of points and lines that form a model. If i have to calculate it outside of spring, then thats what I will do.
How am I insulting people by calling 1 person "not so incredibly dense"? Thats actually what I would consider a compliment. Im pointing out something good about him.
@others:
You guys really dont get it. Ill use big text so you can read it better:
I dont care about drawing. I dont want to know how to draw a wireframe. I dont want to know how to do what you want to know how to do. I dont want to convert to quads. I dont want to do anything except for this: Extract a list of vertices from a model, and extract a list of lines I could use to connect those vertices.
I have learned from Argh, who is a really great guy (no really), that this can only be done right now by parsing the s3o file. Has anyone done anything on this?
Aside from this, does anyone have a way of extracting this data from a file outside of spring? I dont care about the 3d model format or the programming language or what. I need a list of points and lines that form a model. If i have to calculate it outside of spring, then thats what I will do.
Re: Widget request: Extract model data
best would have been/would be, if you had outlined what yo uare trying to do in general, as in:
i want to do a programm/mod/widget that does X and Y, and to do this i need to do Z, and therefore ... i have to get the points and vertices.
i want to do a programm/mod/widget that does X and Y, and to do this i need to do Z, and therefore ... i have to get the points and vertices.
Re: Widget request: Extract model data
I'm going to put this as gently and non-insulting as I can.
If you ask about a widget rendering wireframes, you get told how to render wireframes from a widget.
If you ask about extracting model data with a valid reason, despite the difficulties involved, you will get an answer about that.
Don't insult other people when you came in with a two sentence post expecting it to be easy to get complex 3d model data and failed to clarify why you wanted it, instead repeating your original request.
If you ask about a widget rendering wireframes, you get told how to render wireframes from a widget.
If you ask about extracting model data with a valid reason, despite the difficulties involved, you will get an answer about that.
Don't insult other people when you came in with a two sentence post expecting it to be easy to get complex 3d model data and failed to clarify why you wanted it, instead repeating your original request.
This is either trolling or you're posting at 4am high on cough syrup. Either way, stop it.d_b wrote:@det
How am I insulting people by calling 1 person "not so incredibly dense"? Thats actually what I would consider a compliment. Im pointing out something good about him.
Re: Widget request: Extract model data
d_b wrote:Basically, i need the coordinates so that I can draw a wireframe.
Maybe get your story straight before asking people to "right" you any code, CMU's finest.d_b wrote:I dont care about drawing.
Yes.d_b wrote:this can only be done right now by parsing the s3o file. Has anyone done anything on this?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Widget request: Extract model data
The way he was being "answered" and spoken to was insulting. I would have had the same reaction.det wrote:Way to insult the people who are trying to help you.
Re: Widget request: Extract model data
What? w2dl?Kloot wrote:Yes.d_b wrote:this can only be done right now by parsing the s3o file. Has anyone done anything on this?
At others: >:( Meanface
Re: Widget request: Extract model data
Where would I find the details on parsing and extracting all the data in an s3o?
Re: Widget request: Extract model data
Spring is what? O p e n S o u r c e :p
Re: Widget request: Extract model data
Please bless me with your powers.jK wrote:jK is what? L u a / S p r i n g W i z a r d :p
Re: Widget request: Extract model data
He can't, that involves answering questions, and he doesn't do that until you're semi-competent.
OK...
1. Kloot, do you have any source you'd be willing to share? All I want, personally, is to be able to read a single-object S3O (i.e., it's 'base'). That would be fine, for the things I want to do (read model data for Lua rendering, instead of having to build the display lists in Lua, or porting said objects to OBJ and manually parsing their points, blech).
2. If no... here's what we need to read:
http://github.com/spring/spring/blob/a2 ... Parser.cpp
I'm stuck at step 1 of the process: how do we convert the header and the rest of the hex back into a format we can use?
OK...
1. Kloot, do you have any source you'd be willing to share? All I want, personally, is to be able to read a single-object S3O (i.e., it's 'base'). That would be fine, for the things I want to do (read model data for Lua rendering, instead of having to build the display lists in Lua, or porting said objects to OBJ and manually parsing their points, blech).
2. If no... here's what we need to read:
http://github.com/spring/spring/blob/a2 ... Parser.cpp
I'm stuck at step 1 of the process: how do we convert the header and the rest of the hex back into a format we can use?
Re: Widget request: Extract model data
OK... how's about an easier idea: an OBJ parser? I might be able to do that, it's a non-hex format. Let me look at some stuff.
Re: Widget request: Extract model data
OK, so an OBJ is pretty close to being a display list already. The data we need is:
For each vertex:
Vertex Coordinates:
v 5.956962 0.000000 -14.999999
Vertex Normal:
vn 0.000000 0.242536 -0.970142
Texture coordinates (?)
vt 0.109027 0.142404 0.0
Triangles are defined by specifying the entry X of the vertex coodinates, the vertex normal coordinates, and the texture coordinates:
f 1/1/1 2/2/2 3/3/3
Where 1,2,3 are entries with vertex positions, normals, texture coordinates. Texture coordinates are in order- 1 would use the first entry, 2 would use the second entry, 3 would use the third (I assume that the 0.0 third entry is there for either material support or for 3D textures- not that important either way).
So... basically, we need to read the OBJ file, parse it into lists according to type, and use the "f" lists to build our display list.
For each vertex:
Vertex Coordinates:
v 5.956962 0.000000 -14.999999
Vertex Normal:
vn 0.000000 0.242536 -0.970142
Texture coordinates (?)
vt 0.109027 0.142404 0.0
Triangles are defined by specifying the entry X of the vertex coodinates, the vertex normal coordinates, and the texture coordinates:
f 1/1/1 2/2/2 3/3/3
Where 1,2,3 are entries with vertex positions, normals, texture coordinates. Texture coordinates are in order- 1 would use the first entry, 2 would use the second entry, 3 would use the third (I assume that the 0.0 third entry is there for either material support or for 3D textures- not that important either way).
So... basically, we need to read the OBJ file, parse it into lists according to type, and use the "f" lists to build our display list.
Re: Widget request: Extract model data
http://www.inf.puc-rio.br/~roberto/struct/Argh wrote:I'm stuck at step 1 of the process: how do we convert the header and the rest of the hex back into a format we can use?
Re: Widget request: Extract model data
That's a C file, intended to add that functionality. Question then is: does our Lua allow for struct atm? If not, that would need to be added to the engine.
That said, if the struct is already a complete display list, it'd sure save some time. I suck at parsing / sorting, and the OBJ loader is basically all about that.
That said, if the struct is already a complete display list, it'd sure save some time. I suck at parsing / sorting, and the OBJ loader is basically all about that.
Re: Widget request: Extract model data
routines to unpack C structs are for parsing binary data.
it would merely help you implement spring's parser.
it would merely help you implement spring's parser.
Re: Widget request: Extract model data
Right, you're unpacking the data, so that Lua can read it, then we'd have to go through the same routine as here:
http://github.com/spring/spring/blob/a2 ... Parser.cpp
To arrive at final TRIANGLE_STRIP display lists, more or less. The problem I have with attacking the problem that way is that, very simply, IDK if I can read that well enough to convert it, and it assumes a lot of utility / math functions are present (although some of that is available in LUPS, IIRC, such as cross).
http://github.com/spring/spring/blob/a2 ... Parser.cpp
To arrive at final TRIANGLE_STRIP display lists, more or less. The problem I have with attacking the problem that way is that, very simply, IDK if I can read that well enough to convert it, and it assumes a lot of utility / math functions are present (although some of that is available in LUPS, IIRC, such as cross).