News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

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

daydreamer

my first try at procedural texture
16bit still ca 202 bytes

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

avcaballero

Converting to a 3d floor mapping is not difficult, in short you need to divide by z, the hard part is achieving to make it realistic. I upload an example with sources ;).

Regards.

avcaballero

Hello, daydreamer, this floor is not exactly the same as yours but maybe can helps.

daydreamer

Quote from: avcaballero on May 09, 2013, 05:29:00 PM
Converting to a 3d floor mapping is not difficult, in short you need to divide by z, the hard part is achieving to make it realistic. I upload an example with sources ;).

Regards.
I see you code very different from me, I code by reverse this formula screenx=x/z,screeny=y/z and break out so I can loop screenx and screeny and that creates a random access that complicates to make perlin noise texture on the fly, at close distance need to blend between those pixels I generated
+ the final goal of that circle is to create a racetrack
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

avcaballero

If not misunderstand, you want a racing map. In my opinion you would need to generate several tiles you must join by a tile map, maybe something like this? Once you have achieve it in 2D you can try it in 3D.

Biskbart had a lovely 3d racing example in qbasic, but I believe that his page is in other subjects now. If your are interested in it I can upload it.

daydreamer

Quote from: avcaballero on May 13, 2013, 04:06:25 AM
If not misunderstand, you want a racing map. In my opinion you would need to generate several tiles you must join by a tile map, maybe something like this? Once you have achieve it in 2D you can try it in 3D.

Biskbart had a lovely 3d racing example in qbasic, but I believe that his page is in other subjects now. If your are interested in it I can upload it.
thanks,yes please upload it
I think I will go for break up 3drendering to draw many quad polys to make up floor
and rip a 256 color palette from a road and grass photo,which I use to tween between the original random pixels
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


daydreamer

#7
its not finished yet
I dont know why left part of texture is weird, but middle and right part works tweening between random pixels
the blue gonna be replaced with palette
edit:included a palette from a bryce sunset render and testrender first all 32bits of perlin noise with linear interpolation, second test render of 8bits of that using palette lookup for colors, third a testrender on palette looks like
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

maybe i can ask you guys.....

i have some 2-D image data, X pos, Y pos, and amplitude is represented by color



i would like to learn how to convert it to 3-D image data, and rotate it on 3 different axis....



i am not sure if i want to read about fractals, or what ???   :redface:

daydreamer

you could use d3d and first make a grid of polys where you leave y coordinate and number U and V coordinates evenly from 0.0 on one side to 1.0 to opposite side
and read in data and have a lookup table to translate red to high number in float etc and insert in y dimension in for example dataset for each coordinate in a poly is real4 x,y,z,w,u,v for textured polys, which you read in your texture and set it to be used with d3d stuff
this is from how I learned to rotate with SSE to rotate two circles in parallel
Rotating a point around (0,0,0):

    Recall that the formula for rotating in 2d is:

    Xt = X*COS(í) - Y*SIN(í)
    Yt = X*SIN(í) + Y*COS(í)
   
    Rotations in the third deminsion simply involve rotating on all 3 planes.

    To rotate a point (X,Y,Z) around the point (0,0,0) you would use this
    algorithim:

    1st, rotate on the X axis
   
    Yt = Y*COS(Xan) - Z*SIN(Xan)
    Zt = Y*SIN(Xan) + Z*COS(Xan)
    Y = Yt              --  Note that you must not alter the cordinates
    Z = Zt              --   until both transforms are preformed
   
    Next, rotate on the Y axis

    Xt  = X*COS(Yan) - Z*SIN(Yan)
    Zt  = X*SIN(Yan) + Z*COS(Yan)
    X   = Xt
    Z   = Zt

    And finally, the Z axis

    Xt  = X*COS(Zan) - Y*SIN(Zan)
    Yt  = X*SIN(Zan) + Y*COS(Zan)
    X   = Xt
    Y   = Yt
 
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

FORTRANS

Hi Dave,

   You could use a height map with a ray-tracer.  I think I did
something like that a long time ago with the POVRay ray-
tracer.

Regards,

Steve N.

dedndave

many thanks for pointing me in the right direction guys   :t

gives me a place to start   :biggrin:

FORTRANS

Hi,

   Just a quick example of what I can do relatively quickly in a ray-
tracer.

Regards,

Steve N.

dedndave

yes - that's the idea   :P

i guess Abe was never good-looking - lol

Siekmanski

Hi Dave

Are the images you showed us the originals?
Because I did load them in paintshop pro, the color pallet is not in the right order to get the right amplitudes from it.
I can try to order them on luminance but that's a lot of work. Thus making a heigth map from this image is a bit difficult.

If you want a Direct3d9 source code example how to make a 3D height map from an image and rotation on 3 axis, I can put something together.

I know 2 ways of doing this stuff.
With textures or with vertex colors.
Creative coders use backward thinking techniques as a strategy.