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 with code

Author
Message
Jaskel
18
Years of Service
User Offline
Joined: 13th Jun 2006
Location:
Posted: 14th Jun 2006 04:07


I could use help with this code, it is modified from one of the examples in DB that I am experimenting with. Currently it loads the fence model and copies it across one side of the matrix. First, there is a strange glitch when the program is setting down the fence. The player sphere and the fence model blink on the screen and movement is impossible for a while. Any idea of how I can fix this?

Second, I would like the fence to enclose the matrix (congruent with the side it currently resides upon). Is there a way?

Any help is much appreciated.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Jun 2006 08:13 Edited at: 14th Jun 2006 10:52
ouch. i don't see anything 'wrong' per se that might cause the glitch you described except the methods you're employing, specifically loading the same media over and over again. i'm not sure where you found the code that you're experimenting with but here are some quick changes that might get rid of the problem:

let's start at the top:
change this:

to this:


you can load images (BMP, JPG, TGA, DDS, DIB or PNG) directly as images. the last " ,1 " signifies that it will be used as a texture, which you are here. also, are you sure that bmp is 257x257? think about how many pixels wide and high you're actually grabbing with your 'get image' statement there.

next, this:

is unnecesarily loading the same model and image over and over again. this is where i suspect the glitch lies. the following will do the same thing more efficiently:


now, for outlining the matrix with fence, use something similar to the last for/next loop example. in addition to affecting the X position, apply the modifier to the Z position. i'll leave you to figure that part out on your own. give it a solid try (or 2 or 3 or 5 ) and come back if you can't work it out on your own.

good luck

Virtual Nomad
Athlon XP1800+, Windows XP+SP2, Soyo K7V Dragon+ MB, 1.5Gb 333 RAM, ATI Radeon 8700LT (128Mb)
Jaskel
18
Years of Service
User Offline
Joined: 13th Jun 2006
Location:
Posted: 15th Jun 2006 22:05
DB doesn't recognize instance object... I might have mentioned that i'm using DBC and not professional
Jaskel
18
Years of Service
User Offline
Joined: 13th Jun 2006
Location:
Posted: 21st Jun 2006 01:42
bumped

Login to post a reply

Server time is: 2024-09-25 01:25:58
Your offset time is: 2024-09-25 01:25:58