Call for C++ Documentation Volunteers

Hello.

As anybody that codes with Panda/C++ has noticed, the main problem we have now is that most of the manual sections still haven’t been adapted to from Python to C++.

If you are very experienced with the C++ side of Panda3D and would like to help you can do so by offering to translate some manuals sections. Translating a manual section usually involves providing alternative C++ code for the Python code snippets, although sometimes you may need to alter the text a little due to differences in behavior. If you would like to help let me know and I’ll tell you how to edit the manual.

Any help is appreciated, and you can pick any section to work on, we just ask that you use proper style and that you check that the code works before using it in the manual. Use this thread for questions, me or the core developers will gladly help you with any doubt you have.

1 Like

As you know, I’ll volunteer. Already did some parts.
However, I had a lot of difficulties keeping it in manual style, since I feel the need to use a lot of example code to explain things, when they strongly differ from the Python wrappers.
How do I handle that ? Is it a big problem to have some step-by-step explanations ?

Let me keep this message as a placeholder for the stuff I did, if you don’t mind:

Panda3D Manual: Text Fonts
Panda3D Manual: Text Node
Panda3D Manual: DirectGUI (not done yet, hard task)

Currently working on:
Panda3D Manual: Geometrical MipMapping

If something differs a lot but there’s still some orthogonality (like DirectGUI → PGUI) then you should translate everything including the text, but keep the same structure. The priority here is that each side of the manual makes sense to the people that is interested in either language, don’t be timid if you need make changes for that to happen.

If something differs completely because for example some feature doesn’t exist in C++. Just put some text instead of the content in the C++ side that says that that feature isn’t available in C++, but preferably you should give some pointers about how to implement it.

Or just ask here on a particular basis when you encounter such difficulties and we can discuss it.

Okay, clear.
Can we have an table of stuff done, need to be done, and if somebody is working on it ?

[edit]Oops. With the new layout, the blue login-dot for the wiki seems to be gone ??

About the table of stuff to be done, I asked long ago for a way to mark the sections that were undone, but we never did anything like that. I will discuss it again.

In the meantime, we don’t really need anything like that, just look for sections that aren’t “translated” to c++.

And yeah, I just PM’d you the new link for editing the wiki.

We can create a page that is a copy of the Main page but that indicates (with colors) which pages need to be done, which ones are partially done, and which ones are already translated.

Sounds good to me.

I wish I could help, but I have a lot to learn first. I’ll see what I can anyway.

Late answer, sorry.

If you need help trying to write some code in c++ just ask here. That isn’t a problem. We can help with particular features that you don’t know how to translate to c++, most of the work that is time consuming is straightforward like writing full code, building and testing. So if you need help with something just ask, as long as you know the basics.

i dont know if those both codes are clean enough. or maybe bad documented, but maybe you could use them as test samples? if you want take them, just say me, the points which needs to be improved. like better documented or so on… or overwork the code completly…

the first is about parallel processing:

// PARALLEL PROCESSING -> parallel processing of two distances, this should just display how to parallel processing, of course there is no need to do this twice! ;)
// this processing idea was just coming along to improve the performance at the raster particles for smashBALL, now im able to split my particle calculation up!
// it should improve the performance up to 30 % or more! :D :D :D i hope! but im sure it does :D
// dirk-r. hochegger 2010

#include "pandaFramework.h"
#include "pandaSystem.h"
#include "graphicsEngine.h" 
#include "process.h" 
#include "windows.h"

PandaFramework framework;
WindowFramework *window;
GraphicsEngine *engine;
PT(AsyncTaskManager) taskMgr = AsyncTaskManager::get_global_ptr();
PT(ClockObject) globalClock = ClockObject::get_global_clock();
NodePath camera,model[2];

//init the start position
LVecBase3f pos1 (0.8,0.0,0.0),pos2 (-0.8,0.0,0.0);

//parallel processing related
// declare the parallel processing vars
float dis,dis1;
int isACTIVE = 1; 

void parallelDISTANCEcalc1 (void *);
void parallelDISTANCEcalc2 (void *);


//window open
void windowOPEN() {
	WindowProperties *props = new WindowProperties(); 
    props->set_size(500,500); 
	props->set_origin(500,10);
    props->set_undecorated(true); 
    window = framework.open_window(*props,0);
	window->get_graphics_window()->get_active_display_region(0)->set_clear_color(Colorf(0,0,0,1));
}
// stor camera
void getCAMERA() {
	camera = window->get_camera_group(); 
}
// load model
void loadMODEL() {
	for (int i=0;i<2;i++) {
		model[i] = window->load_model(framework.get_models(),"smiley");
		model[i].set_scale(.1);
		model[i].reparent_to(window->get_aspect_2d());
	}
}

//parallel processing
void parallelDISTANCEcalc1 (void *) {
	while (isACTIVE) {
		LVecBase3f disX = (pos1-pos2);
		dis = disX.length();
		if (dis < .1) {
			pos1.set_x(pos1.get_x());
		}
		else {
			pos1.set_x(pos1.get_x()-.005);
		}
		Sleep(10); 
	}
}

void parallelDISTANCEcalc2 (void *) {
	while (isACTIVE) {
		
		LVecBase3f disX = (pos1-pos2);
		dis1 = disX.length();
		if (dis1 < .1) {
			pos2.set_x(pos2.get_x());
		}
		else {
			pos2.set_x(pos2.get_x()+.005);
		}
		Sleep(10);
	}
}
// using a task for picking the values
AsyncTask::DoneStatus mainTASK(GenericAsyncTask* task, void* data) { 
	model[0].set_x(pos1.get_x());
	model[1].set_x(pos2.get_x());
	return AsyncTask::DS_cont;
}

int main(int argc, char *argv[]) {
	framework.open_framework(argc, argv);
    windowOPEN();
	getCAMERA();
	loadMODEL();

	_beginthread(parallelDISTANCEcalc1, 0, NULL); 
	_beginthread(parallelDISTANCEcalc2, 0, NULL); 

	taskMgr->add(new GenericAsyncTask("main task", &mainTASK, (void*) NULL));

	framework.main_loop();
    framework.close_framework();
    return (0);
} 

the second is about the rigidbodycombiner:

//test rigidBODY node removing (not working)
//dirk-r. hochegger 2010 kind supported by drwr

#include "pandaFramework.h"
#include "pandaSystem.h"
#include "texturePool.h"
#include "PGButton.h"
#include "mouseButton.h"
#include "transparencyAttrib.h"
#include "rigidBodyCombiner.h"


//init vars
PandaFramework framework;
WindowFramework *window;
GraphicsEngine *engine;
PT(ClockObject) globalClock = ClockObject::get_global_clock();
PT(AsyncTaskManager) taskMgr = AsyncTaskManager::get_global_ptr(); 
PT(RigidBodyCombiner) rbc = new RigidBodyCombiner("rbc");
PT(Texture) texturePARTICLE;
PT(PGButton) newINSTANCES;
NodePath camera,rigNode[10000],obj[100000],buttonINS;
int rigNODEid = 0,partCOUNT=100,timerX;
float PARTposY = .5;


/*
opens a window, setting some things, like size, origin on the screen...
*/
void windowOPEN() {
	framework.set_window_title("rigTEST");
	WindowProperties *props = new WindowProperties(); 
    props->set_size(500,500); 
	props->set_origin(500,10);
    props->set_undecorated(true); 
    window = framework.open_window(*props,0);
	window->get_graphics_window()->get_active_display_region(0)->set_clear_color(Colorf(1,1,1,1));
}
// get the camera and stored in var camera
void getCAMERA() {
	camera = window->get_camera_group(); 
}
/*
paints the geometry and assign it on a rigid body
*/
void paintGEO() {
	rigNode[rigNODEid] = NodePath(rbc);
	rigNode[rigNODEid].reparent_to(window->get_aspect_2d());
	float PARTposX = -.5;
	int count = 0;
	for (int i=0;i<partCOUNT;i++){
		obj[i] = window->load_model(framework.get_models(),"box");
		obj[i].set_scale(.04);
		obj[i].set_pos(PARTposX,0,PARTposY);
		obj[i].set_p(90);
		obj[i].reparent_to(rigNode[rigNODEid]);
		PARTposX += .04;
		count++;
		if (count > 24) {
			PARTposY -=.04;
			PARTposX = -.5;
			count = 0;
		}
	}
	rbc->collect();
}
/*
detach the not needed nodes out of the rigid body and detach the rigid body completly and removes the nodes 
(just to be sure that everything is deleted, its not really important, to do this thing twice)
 setting some things, like add 100 new objects , getting back to the start position...
 loop over all objects and set a new scale for it
*/
static void NEWINSTANCES(const Event *ev, void *data){
		PGButton* CurrentButton=(PGButton *)data;
		for (int i=0;i<partCOUNT;i++) {
			obj[i].detach_node();
			obj[i].remove_node();
		}
		rbc->collect();
	//	rigNode[rigNODEid].detach_node();
	//	rigNode[rigNODEid].remove_node();
		PARTposY = .5;
		partCOUNT += 100;
		paintGEO();
		for (int i=0;i<partCOUNT;i++) {
			obj[i].set_scale(.02);
		}
		rigNODEid++;
	}
// get a button
void button() {
	newINSTANCES = new PGButton("newINSTANCES");
	newINSTANCES->setup("newINSTANCES",0.2);

	buttonINS = window->get_aspect_2d().attach_new_node(newINSTANCES);
	buttonINS.set_scale(.05);
	buttonINS.set_pos(0,0,-.5);

	framework.define_key(newINSTANCES->get_click_event(MouseButton::one() ), "button press", &NEWINSTANCES, newINSTANCES);
}
// init the main program
int main(int argc, char *argv[]) {
	framework.open_framework(argc, argv);
    windowOPEN();
	getCAMERA();
	paintGEO();
	button();

	framework.main_loop();
    framework.close_framework();
    return (0);
} 

I will contribute if time permits.

I can contributed some time if people don’t mind a semi-newbie. I’m still learning panda3d, but have years experience in SDK support, SDK/tech article writing as well as SDK creation, organization and editing for new products (as well as dev experience, multimedia and some game).

If anything, I can at least look at it from the perspective of a person who knows C++, but doesn’t know Panda 3D in-depth, yet wants to get up to speed asap --ex. looking for gaps like simple sample code, as well as missing APIs and architectural overviews. (For example, in 1.6 and 1.7, the hello world example talks of the framework and window framework, uses it in the code, but they aren’t listed in the APIs.)

I can’t spend too much time, I’m also on IEEE’s VW working group and organizing the standards and wiki there, but I am definitely hooked on Panda3D and think it would make a great game and VW environment. I’m even using it as my sim environment for my thesis – so I have a definite motivation in the learning curve.

Please let me know if you want me, but I understand if you prefer more long-time Panda-iers.

Best,
CG

I would be willing to help with Mac OS X Snow Leopard documentation.

It is quite troublesome to get to work for a relative newbie and I would be willing to create a couple of simple getting started modules if I can ever figure it out myself.

Have been trying to compile in Code Blocks, XCode and Eclipse environments to no avail.

Getting a simple example with very clear instructions on exactly how to get it to compile may be valuable.

Contact me if this would be of value.

Thanks

I will help after I get some more practice.

I have recently come up with a nice method for GameObjects that doesn’t require inheritance and only applies event hooks per class rather than per instance or that class.

I’m also currently working on some theories to use DOD, Data Oriented Design, to not have any object classes at all. Not sure if this will integrate well into Panda’s node system or not but we will see.

hello,

I have updated the manual section related to Particle Effects in C++. hopefully others will participate more.

panda3d.org/manual/index.php … le_Effects

select C++ to see the update.

Excellent, thanks!

David

Thank you David, :slight_smile:

i have done some minor but very important update to this section:
panda3d.org/manual/index.php … anda_Model

hopefully tomorrow i will add the details on binding models and animations with a complete sample.

i have updated the following section with a sample and seperated python and C++ help.

panda3d.org/manual/index.php … Animations

Great stuff!

David

panda3d.org/manual/index.php … e_on_Linux

I added an SConstruct file to make the example program. It uses python, so I think people would appreciate that :slight_smile: