Page 2 of 3

Posted: Tue Sep 21, 2004 12:49 pm
by afecelis
whoa puh!!! that did it! you are the man!! thnx for the comments and the help. The map runs smoothly now!!

@mm765: thnx! I lost the link to the irc channe. could someone please post it to be used with chatzilla?


ps. has anyone tried the other features? (changing cameras, wireframe rendering , etc). I'm sure my errors are very basic things, like the one Puh detected in y particles.

thanks guys!

I appreciate it! :D

Posted: Tue Sep 21, 2004 1:01 pm
by erSitzt
...i like that signature :)

Posted: Tue Sep 21, 2004 1:04 pm
by afecelis
lol!!! :D

I thought you would....

Posted: Tue Sep 21, 2004 1:07 pm
by jox
hehe, I like it too. Didn't notice it until now... :)

@afecelis:
Server: irc.freenode.net
Channel: #Irrlicht

Link: irc://irc.freenode.net/#irrlicht

Posted: Tue Sep 21, 2004 1:20 pm
by afecelis
Thnx Jox. Jox, can u give me a hand with my event receivers? :D

Posted: Tue Sep 21, 2004 1:31 pm
by Sinclair fan
My ZXSpectrum +2A has a 64k RAM-disc. Cool eh? :D
Im going to have to dig out "Dizzy" and waste more years of my life re-figuring all the little puzzles out again. lol

Posted: Tue Sep 21, 2004 1:44 pm
by jox
Hm, you're having this in your while loop:

Code: Select all

	if (Maya) {
	//maya cam
	camera[3] = smgr->addCameraSceneNodeMaya(); <---------------------
	//Draw scene
	smgr->drawAll();
	} 
//-----------------------------------------------------------------------------------------------//	
	//If Normalcam is used
	if (Normalcam) {
	//Normalcam
	camera[3] = smgr->addCameraSceneNodeFPS(); <---------------------
	camera[3]->setPosition(core::vector3df(-2000,200,0));
	camera[3]->setRotation(core::vector3df(0,90,0));
	camera[3]->setFarValue (50000.0f) ;
	camera[3]->setFOV(1.1);
	camera[3]->setTarget(core::vector3df(-2000,200,0));
	//Draw scene
	smgr->drawAll();
	} 
seems you're addin one camera each frame... thats no good.

Add 2 cameras before the while(device->run())

MayaCam = smgr->addCamerraSceneNodeMaya(...)
NormalCam = smgr->addCamerraSceneNode(...)

these need to be global like the camera array

// before main()
ICameraSceneNode *MayaCam, *NormalCam;

you could also expand your camera array: camera[6] and use camera[4] and camera[5] instead...


then initialize

camera[3] = NormalCam;


in the eventReceiver say:

Code: Select all

	//Key M enables Maya camera
	if (event.KeyInput.Key == KEY_KEY_M && event.KeyInput.PressedDown)
	 {
	   camera[3] = MayaCam;
	   return true;
	    }
	//Key N enables fps cam
	if (event.KeyInput.Key == KEY_KEY_N && event.KeyInput.PressedDown)
	 {
	   camera[3] = NormalCam;
	   return true;
	    }
just quickly made this up, might contain error or two. But you get the idea...

Btw, would help a lot making your code more readably if you'd use some identation:

Code: Select all

main() {
    while(true) {
        if (false) {
        }
    }
}
instead of:

Code: Select all

main() {
 while(true) {
if (false) {
}
}
  }
:wink:

Posted: Tue Sep 21, 2004 6:13 pm
by afecelis
ooooooooopsss!!! :oops:

you're right!!

thanks for all the comments and tips!!! Gonna try that immediately and clean up my code a bit.

I also gotta learn some "codetiquette" so any advice is valuable.

Shall I do the same for the wireframe rendering as well? i mean, declaring everything at the beginning?

Posted: Tue Sep 21, 2004 6:22 pm
by jox
mh, the wireframe thing is not that critical. But you could do this:

Code: Select all

meshnode->setMaterialFlag(video::EMF_WIREFRAME,WireFrame);
sydneynode->setMaterialFlag(video::EMF_WIREFRAME,WireFrame);
instead of this:

Code: Select all

if (WireFrame) {
    //render in wireframe
    meshnode->setMaterialFlag(video::EMF_WIREFRAME,true);
    sydneynode->setMaterialFlag(video::EMF_WIREFRAME,true);
}
to be able to switch back! ;)

Also you could kick out some of your smgr->drawAll() calls...

Posted: Tue Sep 21, 2004 6:29 pm
by afecelis
great Jox! It seems like someone will be having fun this afternoon!!! :D

BTW, what ever happened with the DX mipmapping bug we were tracking? did it get solved? If you compile my test app with DX8-9 you'll se some weird things (jaggies) occur in the shadows. I guess it has to do with the same thing.

many many many thnx!

Posted: Tue Sep 21, 2004 6:34 pm
by afecelis
I had forgotten! MM765, thnx for the invitation, I'll drop by the channel tonight!!

thnx!

Posted: Sun Oct 03, 2004 3:03 pm
by Yan
I'd really like to test your app, but there's always a "404 error" message. Is there a new link?

Thx,
Yan

Posted: Sun Oct 03, 2004 4:13 pm
by blackbirdXXX

Posted: Sun Oct 03, 2004 4:20 pm
by jox

Posted: Sun Oct 03, 2004 5:56 pm
by afecelis
Of course! It's got your help in it!!!! :D :D :D :D


unfortunately it's only the bin version. That's the source I lost!!!!!
:cry: :cry: :cry: