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 / Nothing In The Dark

Author
Message
Mr909
12
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 25th Oct 2012 22:37
So, I've been gaining a basic grasp on most 3d concepts when I stumbled into this doozy of a problem:

I make a matrix. The matrix shows up.
I create height for the matrix, the heights change.
I create a bitmap.
I try to use it to texture the matrix.
Nothing happens.

At first I thought it was a lighting problem, so I used a little sphere that I was drawing on the surface and tried to create a light shining down on it.
The light worked perfectly.
The texture still didn't show up.



I didn't include my camera code, since it is currently my pride and joy (and a serious work in progress). So if you want to compile that to test it, you'll need to set up a camera of some sort.

Anyone see the problem?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Oct 2012 18:58
UPDATE MATRIX Matrix Number

Quote: "
Any changes you have made are not visible until you complete the process by using the update matrix command. Updating the matrix is speed intensive and should be used as little
as possible. The matrix number should be an integer value.
"


Virtual Nomad @ California, USA . DBPro V7.7
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
Mr909
12
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 26th Oct 2012 20:23
Sorry, forgot to paste that line in.

Yeah, I tried that already. Heightmap is working fine. It just won't show my textures for some reason.

Thanks anyways. :\
Mr909
12
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 27th Oct 2012 00:21
New Theory: My graphics card.

Can someone try running this application and taking a screenshot?

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Oct 2012 00:44 Edited at: 27th Oct 2012 00:53
this is what i see, too:



Quote: "
I create a bitmap.
I try to use it to texture the matrix.
"

this concerns me. are you creating a bitmap in order to generate a texture to/from it? or, are you simply loading an image, as in your code above, and trying to use it as a texture for all matrix cells?

folks mis-use the term "bitmap" as it pertains to dbpro. within dbpro, bitmap is not synonymous with image, as some might expect.

the dbpro help files use the following code example concerning a matrix texture:



note, there are no bitmaps involved.

does it work as you'd expect? if so, something else in your app is amiss.

preparing and texturing a matrix is pretty basic, as you see. your code above, including the matrix update that was omitted, is in-line with normal usage.

otherwise, there are too many issues to explore without your providing addition info on your app functionality...

add:
i know you are exploring lighting & fog, some camera work, bitmap usage (?), etc., & all can cause what you're experiencing. if you strip your app to the very basics and then, one by one, add the intermediate/more advanced functions and test them, 1 by 1, you're likely to find the issue...

Virtual Nomad @ California, USA . DBPro V7.7
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

Attachments

Login to view attachments
Mr909
12
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 27th Oct 2012 19:34
YAY!!!!

I figured it out a little after "It is in line with normal usage" and "loading an image". How I came up with this from that is a mystery to me.

DarkBASIC automatically loads textures to [Project's Directory]\media.

HOWEVER, it doesn't automatically CALL them from there.
It was a matter of loading the image from the media folder instead of from "C:\". XD
A simple mistake, but an obvious one.

Thank you so much, Virtual Nomad, for your help. I couldn't have done it without you.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Oct 2012 23:53
Quote: " that is a mystery to me."

me, too. regardless, glad you're back on track

Virtual Nomad @ California, USA . DBPro V7.7
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
Mr909
12
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 29th Oct 2012 01:16
So, Virtual Nomad, here we have a code for a map system in the same general direction I'd planned for my beautiful DZ Cam. I defer to your expertise once more.

Essentially, the map is custom-designed by creating an array and then turning it into an image, dot for dot, based on noise values. This is done so that certain parts of the map can be created at a later point in time, i.e. once the player discovers them.

Then "landmarks" are placed on the map, represented by a 2d sprite at the location of a 3d object Because 2d-on-3d action is what I happen to find attractive.

The only real code-related problems I might want to mention is that OBJECT SCREEN X/OBJECT SCREEN Y only works for an object (obviously) and there is no corresponding function for a 3d point (and, after much Googling, I can't find a decent idea on how to make one) A minor quibble, but the less objects I have to render, the better.

Also, how do I make an image serve as a background for the entire matrix? I tried something with (what I understood to be) tiling, but it didn't work for some reason. I was imagining perhaps a quick-and-dirty solution I didn't know about.

What I really posted this to ask was what you thought of it. You like the way it looks? The backdrop will eventually be changed, haven't decided what I'm doing with it yet. The method is for the main map, the image is just a test dummy to show off what terrain I can map with it so far. It's using DZ Cam in name only, I really cut down on the functions it'll actually use because I don't need to make use of its crazy panning.

Login to post a reply

Server time is: 2024-11-23 17:55:38
Your offset time is: 2024-11-23 17:55:38