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 / A little help needed

Author
Message
Toyguy
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 4th Aug 2007 18:13
I wonder if someone might throw up a little code that will show a plain cube rotating in front of a background image?

I am new to DBPro and have been playing around. I wanted to do what I described above, so I took my best guess at it and it's almost there, but when the object is rotating it wipes out a section of the background with gray.

Here's what the code looks like now:


The commented out bits just texture the cube and make it appear to fly away into the screen. I turned them off while trying to figure it out, but those parts work fine. I just can't see what I'm doing wrong...

Thanks!

Dave
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 4th Aug 2007 20:12
1. Place the following at the top of your code: SYNC ON : SYNC RATE 0

2. Place a SYNC command at the bottom of your loop.

3. If you can see the backdrop (anywhere where you can't see anything else) change SET BACKDROP OFF to SET BACKDROP ON.

That should smarten up your code.

- Jane
Toyguy
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 4th Aug 2007 20:40
No dice Jane

That gives me the exact same behavior. I'll attach a snapshot showing what I mean.

If I turn the backdrop on, my background image is replaced by a blue screen with the cube spinning, so that doesn't help either.

Thanks for helping out!

Dave

Attachments

Login to view attachments
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Aug 2007 21:28
I'd make it a sprite also. I think they may be faster and you can also do more with them if needed. So add this:

then in your loop:
paste sprite 1, 0, 0


Toyguy
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 4th Aug 2007 23:27
OK, changing it to Load Image and then putting Paste Image in the loop doesn't work. Basically, it draws the background, draws the cube, then pastes the background over the cube, hiding it from view. Even if I throw a Show Object in the loop after the Paste Image, I still can't see the cube.

Off to try the sprite method...

Thanks!

Dave
Toyguy
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 4th Aug 2007 23:52
Sprite method doesn't work either. I never see the cube at all that way.

Any other ideas are more than welcome...

Dave
Toyguy
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 4th Aug 2007 23:56
Ahhh, Draw To Back was the ticket! Thanks WindowsKiller!

For those following the discussion, here's the final code that works as I had wanted it to:

Login to post a reply

Server time is: 2024-11-25 13:31:42
Your offset time is: 2024-11-25 13:31:42