Jump to content
  • Advertisement
Sign in to follow this  
Vortez

My 3ds max plugins

This topic is 2635 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i've been develloping those plugins when i first started my game engine and since i just recompiled them with the last studio max sdk, i figured that i could post them here, in the hope someone will find them usefull. You can download them here:
http://www.freewebs.com/vortex666/3ds%20max%20dlls.rar

*************************************************************************************************************************************

INSTALLATION: I've included 3 versions of each plugins, each in separate folder in the archive. VS6 is for 3ds max 8 and below, VS2010, for max 9 and above. Copy the x86 and x64 version in their respective directory (ex. C:\Program Files (x86)\Autodesk\3dsMax\plugins). You also need to copy msvcp100.dll and msvcr100.dll into the "C:\Program Files (x86)\Autodesk\3dsMax" directory (if you prefer, where the "3dsmax.exe" file is located) for the newer plugins versions, or install the vs2010 redistribuable.

*************************************************************************************************************************************

The first one is an heighmap generator, which can turn any bitmap into a 3d mesh. After installing the plugin, select Heightmap in the combobox writen "Standard Primitive", then setup the settings(width, heigh, altitude, smooth filters, displacement). Click in any viewport to bring up the open file dialog, select a bitmap(all bpp format,size and grayscale supported) then click open. You're done. I wouldn't recommand bitmaps larger than 257x257 pixels, since memory consuption increase exponentially with the bitmap size. NOTE: Keep in mind that it take 2x2 pixels to make 1 quad so that why i use 1 unit more for width and height.

*************************************************************************************************************************************

The 2 other ones are a binary file 3d models exporter/importer which support the following:

-Very fast.

-The exporter can save the following data (all optional except the vertices array, of course):
-Index array
-vertices array
-Color array
-Up to 4 texture UV arrays
-Normals array
-Vertex Fog array

-Support multiple objects to be saved in one file.

-Models can be exported/reimported in max without any loss of data

-Models information is saved both in indexed mode and non-indexed mode. For example, you can load a cube in indexed mode if the same texture is used on all faces, but use the non-indexed version for drawing a different textures on each face. This also work for normals and colors (in indexed mode, normals are soft(averaged) instead of "hard", and colors are averaged with each other instead of affecting only one triangle)

-The compression option can be used to compress the file size, but since i won't include any code to load them, just DON'T use it.

I develloped this plugins with opengl in mind, but it can be used with DirectX as well. Here's the file format:


/*****************************************/
/*****************************************/
/********* Main Header (40 bytes)*********/
/*****************************************/
/*****************************************/
/ 16 bytes | Signature /
/ 16 bytes | Version number /
/ 04 bytes | Objects count /
/ 04 bytes | Compressed Flag /
/*****************************************/
/*****************************************/
/********Object Header (108 Bytes)********/
/*****************************************/
/*****************************************/
/ 64 bytes | Obj Name /
/*****************************************/
/ 04 bytes | Obj Color(R,G,B,X) /
/*****************************************/
/ 08 bytes | Available arrays / <= Tell if the specified vertex array is availlable (see note #1)
/*****************************************/
/ 04 bytes | Num Index /
/ 04 bytes | Num Verts /
/ 04 bytes | Num Faces /
/ 04x05 bytes | Num Map Verts / <= See note #2
/*****************************************/
/*****************************************/
/******** Object Data (Indexed) **********/ <= See note #3
/*****************************************/
/*****************************************/
/ 04x03xNumVerts | Index dat /
/ 04x03xNumIndex | Verts dat /
/ 04x03xNumIndex | ColVerts dat (Opt.) /
/ 04x02xNumIndex | TexVerts1 dat(Opt.) /
/ 04x02xNumIndex | TexVerts2 dat(Opt.) /
/ 04x02xNumIndex | TexVerts3 dat(Opt.) /
/ 04x02xNumIndex | TexVerts4 dat(Opt.) /
/ 04x03xNumIndex | Norms dat (Opt.) /
/ 04x01xNumIndex | FogCoord dat (Opt.) /
/*****************************************/
/*****************************************/
/******* Object Data (Non-Indexed) ******/ <= See note #3
/*****************************************/
/*****************************************/
/ 04x03xNumVerts | Verts dat /
/ 04x03xNumVerts | ColVerts dat (Opt.) /
/ 04x02xNumVerts | TexVerts1 dat(Opt.) /
/ 04x02xNumVerts | TexVerts2 dat(Opt.) /
/ 04x02xNumVerts | TexVerts3 dat(Opt.) /
/ 04x02xNumVerts | TexVerts4 dat(Opt.) /
/ 04x03xNumVerts | Norms dat (Opt.) /
/ 04x01xNumVerts | FogCoord dat (Opt.) /
/*****************************************/
/*****************************************/
/********** Importer Data ****************/ <= See note #3
/*****************************************/
/*****************************************/
/ 04x03xNumVerts | Edges Vis. dat /
/ 04x03xNumMapVerts[0] | Map #0 dat(Opt.) /
/ 04x03xNumMapVerts[1] | Map #1 dat(Opt.) /
/ 04x03xNumMapVerts[2] | Map #2 dat(Opt.) /
/ 04x03xNumMapVerts[3] | Map #3 dat(Opt.) /
/ 04x03xNumMapVerts[4] | Map #4 dat(Opt.) /
/*****************************************/
/*****************************************/
/****************EOF**********************/
/*****************************************/
/*****************************************/


Note #1: The available array is simply a 8 bytes array telling if an array is included in the model or not. For example you could save a model with only vertices and normals, with no textures array. The only one that will always be set is the vertices array. Here's the meaning for each bytes:

0 = Vertices Array
1 = Color Array
2-5 = Texture (UV) coords. Array 1 to 4
6 = Normals Array
7 = Vertices Fog Array

Note #2
This value shouldn't be used, since it's only usefull for the importer.

Note #3
So, to make it simple, each file have an header of 40 bytes, followed by 'Objects Count' number of models. Each objects (or models) also have an object header, + 3 sections of datas. Use the first section when loading a model using an index array, and the second one is for the non-indexed version. The 3rd section should be skiped, since it only contain 3ds max data for the importer.

Any questions/sugestion are welcome!

Vortez.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!