Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Help make my code good

Author
Message
gsd
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: London
Posted: 16th Sep 2003 22:51
Hello
Could somebody look at my code. Its meant to be a man walking in one direction and tracked by a static camera. It works pretty well apart from the fact that he has a mirror image of himself above him. This would be great if he was walking by a mirror but he isnt. Also I get this tiny jolt when the object animation loops even though the first and last frames are identical.
Or if someone knows a much better way to make a man walk (which im sure someone does) then please tell me

Thanks

gsd
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Sep 2003 00:43
this is no disrespect to you, but the mods and the DB vets will undoubtedly see this and help you but I would like to start a trend amongst the vets and the mods as far as helping n00bs in general: Can we please promote some sort of structured coding ie Hungarian Notation, indenting, etc ect - is just a suggestion (I know he used SOURCE htm above as opposed to code snip-but still) I feel we are responsible for the newbies and should start teaching them good practices as far as READABLE code. just MHO. If we are here fielding these questions then we have a right to expect some sort of outline how code should be layed out, no?

again, not a dig, just a thought having seen countless posts with BAD programming practices. Sorry

-RUST-
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Sep 2003 01:41
I've had the same problem...don't create a new camera unless you really have to. The way it was explained to me, you are looking at 2 camera perspectives in the same viewport.

CattleRustler: I've written a tutorial on programming practices for DB programmers, it's in a pile of other tutorials on Rich's desk, waiting for us lot to stop hassling him about the new site so he can read them! With any luck, it will be published with the rest of the tuts...soon?

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Sep 2003 06:38
thank goodness.
I'm gonna tut here soon, if no guidelines are laid down

-RUST-
gsd
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: London
Posted: 17th Sep 2003 11:01
Thanks steve i took out the new camera and it works fine.
I know you might think that there is a 'proper' way to code things but if it does what is intended then what does it matter? And surely you can read this code even if it is messy its really simple. I dont think the way ive programmed this created my problem but what stevie said about the camera viewpoints.

gsd
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Sep 2003 14:35 Edited at: 17th Sep 2003 14:37
gsd: There is nothing wrong with the code you've written syntactically, but you might benefit from a few simple tried and tested methods in the long run. You'll see the benefits when your code starts to grow. To emphasise the point, the 2 snippets below do the same, but which would you rather try to debug...





Login to post a reply

Server time is: 2024-11-25 08:51:47
Your offset time is: 2024-11-25 08:51:47