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.

Author
Message
_GTP
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location:
Posted: 9th Nov 2003 00:36
I got the code below from the codebase but i tried to add a cube to the program so the cube could look like it was traveling.

However, it always complains about the object # already existing. No matter what value i use. why does it do that and how can i add objects to it successfully?

i added the line towards the bottom with the comments.

thanks

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Nov 2003 00:42 Edited at: 9th Nov 2003 00:49
you shouldn't have the Make Object cube in the loop it should be before it, then move the cube or do whatever to it in the loop

in other words first time thru loop all ok Make Object Cube 1000,20
second time thru loop, not ok Object 1000 already exists but then you issue another make object cube 1000,20 - that was the error.


-RUST-
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Nov 2003 00:47
i moved what you added to outside the loop and the error goes away but as for the rest of the program, what is it supposed to do? i get nothing but a blank screen.

-RUST-
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Nov 2003 01:26
Remove the CLS command too and it works Ok
_GTP
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location:
Posted: 11th Nov 2003 08:13
HI guys,

thanks for the solution. It was my fault. I didnt even think about the loop.

It was very silly of me.

I tried loading an object into the scene and i'm able to see the object and i think the stars sort of through my object. is there anyway to stop that. i think you'll notice it if you add a cube or some other object.

thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Nov 2003 23:28
This is one place where DBC and DBPro differ. The 3D draws to the current bitmap in DBPro, and always draws to bitmap 0 on DBC (I think)

_GTP
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location:
Posted: 12th Nov 2003 01:29
hey sweet!

so the image was in front of the cube or object in my code and you simply handled it but putting it behind.

classy.



thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2003 14:44
What was happening was that the current bitmap was bitmap 1. Every sync, the screen was being cleared to the backdrop colour, and the cube was being rendered. Then you were drawing the 'stars' over the top, and copying bitmap 1 to the display.

Now the stars are still drawn to bitmap 1, and are copied to bitmap 0. Then the cube is rendered - this works because we have taken control of the backdrop (backdrop off) and we are also telling DBPro to render over the top of our 2d stuff (draw to back).

Login to post a reply

Server time is: 2024-09-21 09:49:34
Your offset time is: 2024-09-21 09:49:34