News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Some startup info needed...

Started by maxxarcher, October 28, 2005, 01:12:55 PM

Previous topic - Next topic

maxxarcher

Hi Everyone,

I'm new to this forum and originally a Delphi (pascal) programmer. Recently I was working on a 3D model manipulation program in Delphi, but I had a diskcrash and lost all my work. Sucks, but my program lacked speed, esp. in traversing huge lists of vertices, so, despite the loss, I needed a fresh start anyway.
First of all, I have very little, ancient ASM knowlegde (pre-Windows and masm 3.dot.something, I believe I still have the "Masm Bible" stashed in a box somewhere), with undoubtedly a lot of studying and tampering ahead. My aim is to (re)write the code I had so far in Delphi and add ASM dll's where speed is needed.

Because I use Poser 5/6, I'm mostly interested in manipulating wavefront OBJ files to create character morphs. With Nate Robins glm.c as an example, I created a reader which supported almost all OBJ statements, including (s)moothing and regular (g)roups, so I was pleased to see glm being used in the Vertex_Array_And_WaveFront_Obj asm example.

Now here I have a few questions/requests:

- Is there an ASM source version of glm I can use for example code, or was the oringinal Robins c-version used? If there's an ASM version, where can I get it (it wasn't supplied in the examples ZIP)?

- Delphi does a lot of memory management, a line of code like : MyListOfStrings := StringList.LoadFromFile("some3D.obj") doesn't need much consideration. How is that compared to ASM? I want to be able to read huge text (OBJ) files, 20Mb>, with the least possible disk I/O. I recall ASM dividing memory into 64Kb chunks, is that still the case or are there easier ways to read large textfiles?

- (f)ace statements reference (v)ertex, (vt)texture coords and (vn)vertex normals in OBJ files. Delphi and C have an easy way (sorta anyway) of using pointers referencing (array) data in memory. How is that compared to ASM? The same, just a different syntax or do some parts need special consideration?

- One final question: Am I in over my head ;-) ?

I'd really appreciate if someone could help me out a bit with the above. Example code would be great, but pointing my nose in the right direction with some info is great too!

Thanks alot!!
Maxx

P1

maxxarcher,

Welcome to MASMforum!        :U

Read around the different areas and get a feel for the place.   

Read the help files and tutorials of MASM32.   ( It's better if you download the MASM32 package and install it.  Than use the MSDN distribution of MASM. )

'Search' & Google are your friends for programming.  Then ask your questions.     :dance:

Quote from: maxxarcher on October 28, 2005, 01:12:55 PMOne final question: Am I in over my head ;-) ?
We all are, just keep the arms and legs moving.   :green2

I don't do graphics myself.  But what you find is we will all help to the extent of our abilities.  In this, you might find yourself the champion of this topic.  And later, share what you have developed here.

'Best in Class' coding results, is my hope for you !

Regards,  P1   :8)

maxxarcher


hitchhikr

Quote
- Is there an ASM source version of glm I can use for example code, or was the oringinal Robins c-version used? If there's an ASM version, where can I get it (it wasn't supplied in the examples ZIP)?

It's still in C, i modified the original one and removed a nasty bug (it didn't handle several materials / group), i also removed some unnecessary (for me) routines.
I included the modified sourcecode with this post.

Quote
- Delphi does a lot of memory management, a line of code like : MyListOfStrings := StringList.LoadFromFile("some3D.obj") doesn't need much consideration. How is that compared to ASM? I want to be able to read huge text (OBJ) files, 20Mb>, with the least possible disk I/O. I recall ASM dividing memory into 64Kb chunks, is that still the case or are there easier ways to read large textfiles?

There's no more 64kb segments. The Files.asm contains the Load_File function which will load an entire file into memory. Otherwise you may want to use mapped files.
As poser's models are rather heavy the parsing will takes a while, maybe a binary based format would be more suitable.

Quote
- (f)ace statements reference (v)ertex, (vt)texture coords and (vn)vertex normals in OBJ files. Delphi and C have an easy way (sorta anyway) of using pointers referencing (array) data in memory. How is that compared to ASM? The same, just a different syntax or do some parts need special consideration?

Check the sourcecodes, you can create structures and arrays to present datas in asm too.

[attachment deleted by admin]

maxxarcher

Thanks hitchhikr, you got me going alright.

Regarding the wavefront format, I have thousands (really!) of OBJ models, so I'll stick to that format for the time being. I knew about the bugs (and noticed the lack of them in your example), so I didn't use the actual Robins code. Also, the original code triangulated the models, which is out of the question if I want to share morph/delta files for object(groups).
For normal calcs I used the Newell equation instead, though I'm not sure I utilized the right way.

Anyway, as soon I got some working code, I'll report back...

Cheers!

Farabi

Quote from: maxxarcher on October 28, 2005, 11:42:11 PM
Thanks hitchhikr, you got me going alright.

Regarding the wavefront format, I have thousands (really!) of OBJ models, so I'll stick to that format for the time being. I knew about the bugs (and noticed the lack of them in your example), so I didn't use the actual Robins code. Also, the original code triangulated the models, which is out of the question if I want to share morph/delta files for object(groups).
For normal calcs I used the Newell equation instead, though I'm not sure I utilized the right way.

Anyway, as soon I got some working code, I'll report back...

Cheers!

Have a free character model arranged like on the attachment?

[attachment deleted by admin]
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

maxxarcher

Sorry, nope, I haven't. But you might want to have a look in the free area at http://www.renderosity.com