AnniXa Posted August 22, 2011 Share Posted August 22, 2011 I actually programming my first game with LW, and i want it to have some kind of 2d physics, with a pseudo 3d optic (3d meshes but allways seen from same site) is there a easy way to fix all stuff onto a Z row? i mean can we just set some kind of "2d" mode? my actuall ideas was to pack the whole game into 2 flat plates but this is very dirty, otherwise i tryed to set every body onto z = 0.0 in every gameupdate, but this can also be not the best solution. is there any easy way to get this out of the box? =) Quote Whuts wroong? Link to comment Share on other sites More sharing options...
DaDonik Posted August 22, 2011 Share Posted August 22, 2011 You can use CalcBodyVelocity to calculate the velocity needed to keep your entities on z = 0.0. Just use the current position, set z = 0.0 and then calculate the force. Apply the force the command returns to your body and voila. Edit: LW is lightwave, LE is leadwerks Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
AnniXa Posted August 23, 2011 Author Share Posted August 23, 2011 ty Dadonic, i think i also need to do this in every update? seems like i not come around doing stuff for all bodys every time ? You can use CalcBodyVelocity to calculate the velocity needed to keep your entities on z = 0.0. Just use the current position, set z = 0.0 and then calculate the force. Apply the force the command returns to your body and voila. Edit: LW is lightwave, LE is leadwerks Quote Whuts wroong? Link to comment Share on other sites More sharing options...
DaDonik Posted August 23, 2011 Share Posted August 23, 2011 Jeah you pretty much need something like a Make2D function which does this once per frame for each body you want to behave like that. Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted August 31, 2011 Share Posted August 31, 2011 Leadwerks physics (or rather Newton physics) is deterministic... meaning its 100% predictable and things will happen the same every time no matter what... So provided that all your bodies are symetrical along the z axis simply ensure that all your force's vectors have z at 0 and ensure everything starts at z=0. I don't think it is actually possible in this case for the z to change at all. I don't see why this wouldn't work as I have never had a random physics jump to an axis I haven't specified. It should stay perfectly spot on.. Guess the only way to find out is to give it a shot... A 'Make 2D' function probably wouldn't work imo because it sounds like your trying to make something that is essentially 3D but plays like a 2D game kinda like 'Valkyrie Profile' which is a 3D side Scroller. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Josh Posted August 31, 2011 Share Posted August 31, 2011 You could always put two enormous bodies on either side of the plane you are interested in allowing, and constrain objects that way. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted August 31, 2011 Share Posted August 31, 2011 You could always put two enormous bodies on either side of the plane you are interested in allowing, and constrain objects that way. That is a good idea to. Do that as well to be safe Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Naughty Alien Posted September 2, 2011 Share Posted September 2, 2011 ..as for 3D optic, set your camera far away and then use CameraZoom to get 'flatten' orthogonal look like screen projection..as for physics..you dont have much choice with Newton, but something along Josh suggestion... Quote Link to comment Share on other sites More sharing options...
Robby Theves Posted September 16, 2011 Share Posted September 16, 2011 You can also go for magic-software for getting physics code in 2d, you can also have there 3D geometry and background there as I have done in my last project. Quote used office furniture dade Link to comment Share on other sites More sharing options...
Rekindled Phoenix Posted September 16, 2011 Share Posted September 16, 2011 You could always put two enormous bodies on either side of the plane you are interested in allowing, and constrain objects that way. Doing this with more than a couple dozen object causes a huge FPS drop. Updating the positions is the way to go. In order to get a speed increase, I first checked if the object moved beyond a minimum threshold, usually "0.1". That way updates to the object happen evey once in a while and not every frame. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.