Octree Compiling / DLL Export Names
Hi there
I have a couple of questions...
Octree Compiling (for people who know alot about octree-compiling already)
At the moment, when searching for polygons that fit in a child node, I only check to see if all of the points lie within the bounding box - should I be doing an intersection test to check if the polygon intersects the bounding box as well?
DLL Export Names (for people who know a bit about DLLs)
OK, I''m creating a 3D engine, with 2 or 3 different dynamically-loaded .DLL (using LoadLibrary, etc.) that are rendering drivers (OpenGL, Direct3D, etc...).
There are about 15-20 functions that I need to dynamically load into my engine. However, in a past project this ended up in function names being exported as things like DrawMeshR_TX234X4 (example), where the function was called "DrawMesh".
Note that if possible, I''d like to be able to use the __declspec(dllexport) specifier, as I always have - if not, how can I set up a .def file or whatever?
thx
---------------
kieren_j
ÿDesigned for Win32
For the DLL export names:
I think (but am not 100% sure) that if you declare the functions as extern "C" the names will not be decorated. You should still be able to use them with _declspec.
Hope this helps!
I think (but am not 100% sure) that if you declare the functions as extern "C" the names will not be decorated. You should still be able to use them with _declspec.
Hope this helps!
Hi,
Thanks for replying, I was just wondering how I would apply the extern "C"? Like this? :
---------------
kieren_j
ÿDesigned for Win32
Thanks for replying, I was just wondering how I would apply the extern "C"? Like this? :
// bad exampleextern "C" __declspec(dlexport) int Add(int a, int b){ return a+b;}
---------------
kieren_j
ÿDesigned for Win32
Well nevermind I figured it out
So, anybody got any thoughts on my octree problem?
thx
---------------
kieren_j
ÿDesigned for Win32
So, anybody got any thoughts on my octree problem?
thx
---------------
kieren_j
ÿDesigned for Win32
plz..?
---------------
kieren_j
ÿDesigned for Win32
Edited by - kieren_j on September 14, 2000 1:45:36 PM
For the octree you need to do three tests. You need to check if any of the points of the face you are testing are inside a node. You also have to check whether or not a side of the face intersects the node. Finally, you have to check if the diagonals of the node intersect the face. If all of these are false then the face is not included in the node.
-BacksideSnap-
-BacksideSnap-
For the DLL stuff :
to avoid exporting/importing every single function in your DLL, why don''t you simply stick them into an interface class ? It seems to me that your functions are groupable so it should be no problem to do so. You then simply have to implement a function in your DLL that returns a pointer to that interface (let it be a singleton or something; just to make sure you only have one and only one instance of that class ).
The .def-file would only contain that function.
Example :
DLL
---
IDrawMesh*
GetDrawMeshInterface()
{
return CDrawMesh::TheInstance();
};
DEF
---
LIBRARY MESHDRAW
DESCRIPTION "Dll to draw meshes."
EXPORTS
GetDrawMeshInterface @1
Well, you should know the rest...
Kind regards,
Metron
to avoid exporting/importing every single function in your DLL, why don''t you simply stick them into an interface class ? It seems to me that your functions are groupable so it should be no problem to do so. You then simply have to implement a function in your DLL that returns a pointer to that interface (let it be a singleton or something; just to make sure you only have one and only one instance of that class ).
The .def-file would only contain that function.
Example :
DLL
---
IDrawMesh*
GetDrawMeshInterface()
{
return CDrawMesh::TheInstance();
};
DEF
---
LIBRARY MESHDRAW
DESCRIPTION "Dll to draw meshes."
EXPORTS
GetDrawMeshInterface @1
Well, you should know the rest...
Kind regards,
Metron
----------------------------------------http://www.sidema.be----------------------------------------
Regarding the octree thingy:
I have a point-on-plane side function, I suppose to test if a line intersects a plane - see if the points are on different sides?
Anyways, would this be ok for intersecting the face sides - just create a plane for each side of the bounding box? And what do you mean by face diagonals?
thanks again
I have a point-on-plane side function, I suppose to test if a line intersects a plane - see if the points are on different sides?
Anyways, would this be ok for intersecting the face sides - just create a plane for each side of the bounding box? And what do you mean by face diagonals?
thanks again
No, not FACE diagonals. You need to see if the diagonal from one corner of the node to the opposite corner (there will be 4 of them) intersects the face. And you have to check against the face, not it''s plane. A plane is infinite in space. If you need a triangle intersection routine there is a sample program on my site (click on my name). You can find better ones at:
www.realtimerendering.com
there is some good octree stuff here:
octant project
-BacksideSnap-
www.realtimerendering.com
there is some good octree stuff here:
octant project
-BacksideSnap-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement