Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 14th March 2004, 06:39 AM   #1
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Please Help!

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
LiveWire is offline   Reply With Quote
Old 14th March 2004, 08:12 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,379
Default Re: Please Help!

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
Andy is offline   Reply With Quote
Old 14th March 2004, 08:41 AM   #3
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Re: Please Help!

Quote:
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 is offline   Reply With Quote
Old 15th March 2004, 06:31 AM   #4
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Re: Please Help!

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...


testing out the uv's...


two terrains 'stiched' together, then smoothed, texture = hieghtmap...


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
LiveWire is offline   Reply With Quote
Old 15th March 2004, 11:59 AM   #5
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,379
Default Re: Please Help!

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
Andy is offline   Reply With Quote
Old 16th March 2004, 04:29 AM   #6
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Re: Please Help!

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:
Quote:
#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:
Quote:
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 is offline   Reply With Quote
Old 16th March 2004, 06:00 AM   #7
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Re: Please Help!

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...


SmartSurface ON...


notice the difference

.the holes problem is fixed
.and i made it so you could make terrains out of larger images, like this one...

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
LiveWire is offline   Reply With Quote
Old 16th March 2004, 10:44 AM   #8
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Please Help!

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
Dennis is offline   Reply With Quote
Old 17th March 2004, 01:57 AM   #9
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Re: Please Help!

thank you, thats exactly what i wanted to know.
well it works, ive now got to start making the plugin.

Philip
LiveWire is offline   Reply With Quote
Old 23rd March 2004, 11:47 PM   #10
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Re: Please Help!

k, im having trouble creating an object that i can add vertex's to, and then submit back to ac3d.
how-to anyone?

Philip
LiveWire is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 03:18 AM.


AC3D Forum
(C) Inivis Limited 2020