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 / Stars behind Spinning Earth

Author
Message
jerryd
11
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 16th Mar 2013 02:39
DarkBasic forum,

I have the famous "spinning earth" program working and now
I want to add a background .bmp file. As you can see in
the code all I added are the load image and a paste image
commands. All I can get on the screen is the background
unless I move the window, then the spinning earth shows
up. Must be some trick to this.


Sync on
Sync Rate 0

Color Backdrop rgb(0,0,0)
Make Object Sphere 1, 100, 40, 40

Load Image "earthmap1k-jpg.bmp", 1
Load Image "stars-png.bmp", 2
Texture Object 1, 1

Set Ambient Light 100
Color Ambient Light rgb(255,255,255)

Position Camera 0, 20, -300

Do
Paste Image 2, 0, 0
Yrotate Object 1, object angle y(1) + 0.02
Sync
Loop


jerryd
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 16th Mar 2013 03:22
use "TEXTURE BACKDROP" command

Attachments

Login to view attachments
jerryd
11
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 16th Mar 2013 03:36
pcRaider,

Thanks that worked although the help file says this command
is obsolete.

jerryd
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Mar 2013 04:09 Edited at: 16th Mar 2013 04:09
Quote: "this command is obsolete."

it was re-instituted under 7.4 tho the help file wasn't updated when it was.

Virtual Nomad @ California, USA . DBPro V7.7 . Matrix1Utils 05.27.12
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 16th Mar 2013 04:51
ok, this is cubu in earth.

Attachments

Login to view attachments
jerryd
11
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 18th Mar 2013 03:35
pcRaider,

Thanks that code snippet worked and told me a lot.

jerryd
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 18th Mar 2013 05:42
Here is a tutorial of a skybox. Attach


The media of a skybox is included in DarkGDK,
You can download DarkGDK free,
It is good that you obtain it.

Attachments

Login to view attachments
Inflictive
15
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 1st May 2013 07:28
Make a bigger sphere and texture it with the stars texture, also use

set object cull

to ensure that it draws even though youre inside of it. That way the stars move when the camera moves, its called a skybox/sphere

Login to post a reply

Server time is: 2024-11-23 15:05:03
Your offset time is: 2024-11-23 15:05:03