News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

this would be nice to develop to 3d floormapping

Started by daydreamer, May 09, 2013, 03:59:28 AM

Previous topic - Next topic

FORTRANS

Hi,

   Yes, I tried using the posted image as a height field.  It did not
work out.  One would have to have the raw data or the palette
that was used to create the image to recreate the raw data.
Not to mention that different programs would probably treat an
image as a height field differently.

Cheers,

Steve N.

dedndave

this is a 24-bit image
actually, it is a 256-color image when displayed
i will see if i can make one


dedndave


Siekmanski

Nice, it's rgb from blue 000001h to red ff0000h.
We can make a height map from this image.  8)
Creative coders use backward thinking techniques as a strategy.

FORTRANS

Hi Dave,

   I converted your image to gray scale for a height field.  It isn't
too bad, though the mapping is not all that good.  I'll see if I can
use that palette to convert things and try again.  Off to write a
tool I guess.

Cheers,

Steve N.

dedndave

don't write a tool, Steve

this evening or tomorrow, i will post some 256-color images with the palette in the same image
the mapping is pretty simple, then - the higher the palette numer, the higher the Z amplitude

however, you should be able to use the palette image above to get numbers   :P
if we have 256-color images, the actual color won't matter, though - lol

also - i may adjust the palette curve to make better looking images

dedndave

these are big images
you can crop out any section of either - to a size that suits your needs
the palette entry numbers indicate amplitude - that makes it easy to convert image data

image1.zip ~1.6 mb
http://dedndave.x10.mx/Files/image1.zip

image2.zip ~3.44 mb
http://dedndave.x10.mx/Files/image2.zip

i really appreciate your help with this   :t

daydreamer

#22
I have a problem with this so this ends up a .99mb .exe so I can't post it here, so is my included lib
hope Siekmanski could share his smaller d3d9 includes and libs here
but this d3d shows how you can setup a grid of polys which I change UV coordinates to animate a water texture, you can change it to instead change Y coordinates reading from your file in the section that writes to vertexbuffer and make grid size based on image size, and I also didnt get d3d to work correctly so I did oldschool x/z,y/z 3d view instead
shows how it can look with my textures
also starts looking for my old grand canyon files, I have somewhere a west and east 9mb each file some odd textfile format with height in meters written down evenly divided without 'enter' between each row
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Siekmanski

Nice and usable pictures to create height maps.  :t
Hope to finish an example in d3d9 this weekend and post it including source code and libs.  :biggrin:
Creative coders use backward thinking techniques as a strategy.

dedndave

interesting code daydreamer - i am reading it and trying to comprehend   :biggrin:

Thanks, Marinus - i thought that would make life easier - lol

daydreamer

I am busy cleaning and now debugging my perlin noise code
my d3d9 code is like that because I am not skilled enough to make waterfall and sea with pixelshaders

@Dave: I highly recommend you take a look at Ultranos ATC and Homer's d3d9 coding
ATC is very helpful as it makes it possible to take directx C++ code data section without need tedious recode all FLOAT'S to REAL4'S
Homer has a lot of d3d9 coding examples to learn from, I just dug up few of his demos from my old backup drive

@Marinus: I started bryce to try to export some nice rocky bumpmap to add detail to Dave's landscape
I did this because some I got inspired by ATI sdk I found a cave demo screensaver
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

dedndave

thanks - i am familiar with ultrano - let me see what i can find   :t

by the way....
the images use 36 "actual" vertical data points
my code interpolates values in between to come up with 771 pixel high images
(35 x 22 + 1 = 771), i interpolate 21 points between each data point
for now, i am using linear interpolation
later, i may use some sort of best-fit curve function to get nicer results
i am guessing you will be able to notice the linear interpolation in the 3-d transform   :P

btw: i can wrap my head around 3-d transformation, easily enough
the part i don't understand is "this part is visible, this part isn't" - lol

FORTRANS

Quote from: dedndave on May 18, 2013, 07:44:48 AM
don't write a tool, Steve

this evening or tomorrow, i will post some 256-color images with the palette in the same image
the mapping is pretty simple, then - the higher the palette numer, the higher the Z amplitude

Hi Dave,

   That speeds things up a good bit.  My tool chain is a bit old, so
small images only for now.  But you should get the idea.

Regards,

Steve N.

dedndave

that is cool
you CAN see the linear interpolation   :biggrin:

FORTRANS

Hi Dave,

Quote from: dedndave on May 19, 2013, 12:37:28 AM
that is cool

   Thanks.

Quote
you CAN see the linear interpolation

   That can be turned off.  But I think it looks nicer with it on.
I have some lighting options on as well.

Regards,

Steve