View Full Version : Please Help!
LiveWire
14th March 2004, 06:39 AM
k this is my first time writing a plugin for any application and i need a little help.
i have the ac3d sdk, all the newest headers, and ac3d.lib.
my problem is, that i dont know how to compile anything thats not a win32 application. so how can i write a plugin file '.p' for ac3d?
im using VC++.NET
im trying to write a terrain genarator plugin.
i have most the code finish, but its a compiled as win32 that exports a .ac file which i can load into ac3d(still not finished writing the exporter :wink: )
im trying to get this to be a plugin....can anyone help?
thanx
Philip
Andy
14th March 2004, 08:12 AM
The samples come with a makefile. It's quite simple.
compile with 'nmake -f <makefilename>'
If you want to do it all inside VC++, you will need to make a dll and rename the .dll to .p (a .p file is a dll)
Andy
LiveWire
14th March 2004, 08:41 AM
compile with 'nmake -f <makefilename>'
sorry, but what is nmake -f? some feature of VC++? :?:
also how do i create create a .dll, sorry never messed with that type o thing before :roll:
Philip
LiveWire
15th March 2004, 06:31 AM
k, ive completed my the basic terrain generator
still need to tweak it, add a few things, and fix a couple of bugs.
heres some screens of terrains imported into ac3d:
basic terrain, with water...
http://img26.photobucket.com/albums/v79/witte2008/TGen02.jpg
testing out the uv's...
http://img26.photobucket.com/albums/v79/witte2008/TGen01.jpg
two terrains 'stiched' together, then smoothed, texture = hieghtmap...
http://img26.photobucket.com/albums/v79/witte2008/TGen03.jpg
all the terrains are exported as quads, no textures.
mabye ill make it export as triangles later.
BUGS:
.if you notice on the last one, there are a couple of holes... beets me
they arnt there until i triangulate the terrain in ac3d, so im thinking it might be a bug in the triangulate comand, mabye.
if i dont triangulate, i end up with these nasty red sufaces, because the surface is 'bent' to much in the wrong direction.
.it supports .bmp files, but it freezes when they are 256x256 or bigger
i think this is because i make a vertex for every pixel of the bitmap, so 256x256 is quit a lot of vertex's.
id rly like to make this into a plugin, but im still trying ot figure out how to make a .dll file.
ive search for tutorials online, and came up with zero
anybody know of any site that would help me?
also...
anyone have any ideas about what should be added in?
im thinking about making a 'sphereical' terrain mode, so you could make a 'world' with the terrain map.
thanx
Philip
Andy
15th March 2004, 11:59 AM
Very nice!
use nmake from a command prompt. Have a look at the makefile in the SDK.
To make a dll from inside VC++, select it as the type when you make a new project.
Andy
LiveWire
16th March 2004, 04:29 AM
wow i must have been completely blind to have missed the DLL radio button. lol
k so i can make a .dll(or .p) but now im having problems with code
the code:
#include "ac_plugin.h"
AC3D_PLUGIN_FUNC int AC3DPluginInit()
{
return 0;
}
AC3D_PLUGIN_FUNC int AC3DPluginExit()
{
return 0;
}
AC3D_PLUGIN_FUNC char *AC3DPluginAbout()
{
return "";
}
i have the ac3d.lib included
it makes acTest.dll wich i change to acTest.p and drag into the plugins folder.
i get this message as ac3d boot:
AC3DPluginInit not found in plugin file D:\Program Files\AC3D4\plugins\acTest.p
plugin error 'AC3DPluginInit'
- The operation completed successfully.
all i want is to load my plugin into ac3d without getting this message, any ideas why its messing up?
is it because i have nothing in AC3DPluginInit()?
Philip
LiveWire
16th March 2004, 06:00 AM
k ive updated the terrain generator by adding:
.save as triangles or quads
.smart surface
smart surface, is a nifty little option i add to remove 'jagged' edges
example:
SmartSurface OFF...
http://img26.photobucket.com/albums/v79/witte2008/SSNone.jpg
SmartSurface ON...
http://img26.photobucket.com/albums/v79/witte2008/SSOn.jpg
notice the difference
.the holes problem is fixed
.and i made it so you could make terrains out of larger images, like this one...
http://img26.photobucket.com/albums/v79/witte2008/HPterrain.jpg
131, 072 triangulated surfaces, made from a 256x256 image
i dont know exactly how big of images it handles.
i realy want to make this into a plugin, so any help on plugin writing would be great.
Philip
Dennis
16th March 2004, 10:44 AM
Here are the basic steps I've found works to write an ac3d plugin in Visual Studio (using version 6):
1. Create a DLL project
2. Include the ac3d.lib library
3. Include the ac_plugin.h file
4. In Project settings:
Add "WINDOWS" (without quotes) to "Preprocessor definitions" in C/C++ tab
Set "Output file name" to [projname].p in Link tab
If you follow all of these steps, it *should* work.
I learned to use the AC3D plugins by copying off and editing the "test.c" code that came with the plugin samples in the "dev/plugins" folder. Can you get that code to work for you?
EDIT: Changed the ac3d.h file to ac_plugin.h
LiveWire
17th March 2004, 01:57 AM
thank you, thats exactly what i wanted to know.
well it works, ive now got to start making the plugin.
Philip
LiveWire
23rd March 2004, 11:47 PM
k, im having trouble creating an object that i can add vertex's to, and then submit back to ac3d.
how-to anyone? :D
Philip
monster
24th March 2004, 01:31 AM
Try;
Prototype ACObject *new_object(int type);
and
Prototype void object_add_vertex(ACObject *ob, Vertex *p);
or
Prototype Vertex *object_add_new_vertex(ACObject *ob, Point3 *p);
LiveWire
30th March 2004, 04:46 AM
ive been kinna neglecting making my plugin ...and ive been busy elsewhere :lol:
but im trying to get back to it.
im thinking i will just make it as an importer rather than a tool with tcl(mabye ill make a tool later)
but all the samples that came with the sdk are old, so right now i dont know how to "register" an importer.
ac_register_file_importer(char *name, char *suffix, char *desc, ac_file_importer_func func, char *info);
ok so i make a ac_file_importer_func function, but what exactly is it suppose to return?
how do i make an ac_file_importer_func function that returns a ac3d model?
if anyone has any importer code, that they could send me, that would be awsome.
monstar: creating the object wasnt the my problem, it was getting it back to ac3d. sorry should have explaind myself better.
Philip
Andy
2nd April 2004, 12:15 AM
When you add an importer, you pass the funtion that AC3D will call to load an object e.g.
ac_register_file_importer("3DS", ".3ds", "3D Studio", ac_import_3ds, ac_import_3ds_info);
ACObject *ac_import_3ds (char *filename)
{
// open the file
// create AC3D object structures
// return the top object
}
the sv import code from the SDK is a simple example of how to create an object structure.
Andy
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.