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

dedndave

if i answer Yes to vertex processing, it says Can't create direct-3d device
if i answer No.....


qWord

Quote from: dedndave on May 20, 2013, 08:52:03 AM
if i answer No.....
Can you please test the attached program to see if the issue is fixed?
I've also add some lighting and the graph can be translated along the x and y axis by pressing CTRL while mouse dragging.

qWord

MREAL macros - when you need floating point arithmetic while assembling!

dedndave

much better   :t



try using this image
it is a 256-color bmp
the palette index (0 to 255) is the height


FORTRANS

Quote from: dedndave on May 20, 2013, 03:16:08 AM
that is AWESOME, Steve   :t

Hi Dave,

   Glad you liked it.  Here is the scene description / code that I used.
More complex than needed as I try to set up a right handed, Z up
coordinate system rather than the default left handed, Z forward
system.  Which is why the penny came out backwards I guess.
I think the include files are no longer used, so ignore them.

   I fire up the ray tracer every year or so to look at things.  See
http://www.povray.org for the current version.  I still
use the old version that came with the book I bought back when.
I tend to like hard copy documentation.

Regards,

Steve N.


// Height.POV, 17 May 2013, SRN
// Height field excursion from MASM Forum

#include "colors.inc"           // Standard colors library
#include "shapes.inc"
#include "shapes2.inc"
#include "textures.inc"

// Force a right handed system
camera { location < -1, 0, 1.5 > direction < 2.25, 0, -0.5 >
         up < 0, 0, 1 > sky < 0, 0, 1 > right < 0, -1.33, 0 > }

light_source { < 1, 2, 2 > color red 1 green 1 blue 1 }
light_source { < 2, 1, 2 > color red 1 green 1 blue 1 }

background { color White }

// Data

// // Background
// plane { z, -1.0
//   texture {
//     pigment { checker color rgb < 1.0, .7, 1.0 > color White }
//     finish {  ambient 0.1 } } }

// Height field data

// height_field { gif "New-1.GIF" smooth pigment {
height_field { gif "New-1.GIF" pigment {
                 gradient y color_map {
                   [ 0.0 color red 0 green 0 blue 1 ]
                   [ 0.05882 color red 0 green 0.35294 blue 1 ]
                   [ 0.21961 color red 0 green 0.79216 blue 0.72549 ]
                   [ 0.29020 color red 0 green 1 blue 0.25882 ]
                   [ 0.33333 color red 0 green 1 blue 0 ]
                   [ 0.49804 color red 0.98824 green 1 blue 0 ]
                   [ 0.53725 color red 0.99216 green 0.91765 blue 0 ]
                   [ 0.64706 color red 0.97647 green 0.69020 blue 0 ]
                   [ 0.72941 color red 0.95686 green 0.51765 blue 0 ]
                   [ 0.78431 color red 0.94510 green 0.40784 blue 0 ]
                   [ 0.88627 color red 0.90980 green 0.20392 blue 0 ]
                   [ 0.95686 color red 0.86667 green 0.07451 blue 0 ]
                   [ 1.0 color red 0.82745 green 0 blue 0 ] } }
//               finish { phong 0.3 }
                 finish { ambient 0.75 }
               scale < -1.66, 0.3, 1.25 > rotate < 60, 0, 90 > translate < 1.5, 0.85, 0.5 > }

dedndave

thanks Steve - let me see what i can learn from it   :t

Siekmanski

Hi guys

Here are some D3D9 heigthmap examples without using the D3DX9 library.
Bitmaps are embedded.

Press F1 to toggle Fullscreen.

1. BMP of 64 by 64 with 4096 color vertices and 7938 polygons.
2. BMP of 128 by 128 with 16384 color vertices and 32258 polygons.
3. BMP of 256 by 256 with 65536 color vertices and 130050 polygons.

Had a lot of visitors at my house this weekend, so better late than never hahahaha....
I'll clean up my source code this week and post them.

@Dave, hope you wanted something like this.
Creative coders use backward thinking techniques as a strategy.

dedndave

hi Marinus
thanks for trying, but on all three, i get "unable to create Direct3D Object"   :(

Siekmanski

Creative coders use backward thinking techniques as a strategy.

dedndave

that one flies   :t

very nice image, too

the "top" edge flashes as it rotates, but i suspect that could be easily fixed

Siekmanski

So it works now?

I like to now if there where others who downloaded the examples and have problems running the 3 examples.
So I can locate the error.
Creative coders use backward thinking techniques as a strategy.

dedndave

yes - the 4th one works pretty well

if it helps, i am running XP SP3, prescott @ 3 GHz, 2 Gb ram
the video is intel 82915GV Express Chipset on the motherboard
for it's time, it was decent stuff, but it's time was about 8 years ago - lol

Siekmanski

Seems to be a "IDirect3D9::CreateDevice" BehaviorFlags issue. ( type of VERTEXPROCESSING )
Like to hear from the other guys who tested the examples and make a fix then.

The "top" edge flashes are probably the very sharp 1 pixel height difference.
I'll make an amplitude factor in my code so you can play with that.
Creative coders use backward thinking techniques as a strategy.

dedndave

you might look at qWord's examples
he got around the issue by using software vertex processing, as opposed to hardware

Siekmanski

@Dave,

I changed the type to "software vertex processing" in the 4th example.
I'm searching for the best type of VERTEXPROCESSING on the videocard.

Can you test this one and tell me what vertex processing type you have?
Creative coders use backward thinking techniques as a strategy.

dedndave

HAL software vertex processing

funny - i was just looking at that example
it was in with your include files on the old forum   :P