Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetWorldTransform and 3d Perspective 4

Status
Not open for further replies.

DrJavaJoe

Programmer
Oct 3, 2002
2,143
US
I'm trying to use SetWorldTransform to build and rotate a 3d object. I'm having a difficult time getting the side to rotate around the center point and still maintain it's position with respect to the front panel. I cannot seem to get the math right for the second Transform, I thought about using the CombineTransform to do a second transform but all effort has failed. Also any clue to how to get the perspective to have that 3d affect would be nice. I have posted the test project, so it may be a bit messy. You'll need a timer, 3 command buttons and a picturebox.

My goal here is to take existing panel objects, which already contain all the properties, Angle, Width, Height, Cutouts, even their own dc's for output to emf files, etc. and creating a 3-d image with them all combined into a unit object. This object would then be displayed with the ability to rotate from side to side.

Option Explicit
Private Declare Function CreateSolidBrush Lib "gdi32" _
(ByVal crColor As Long) As Long
Private Declare Function BitBlt Lib "gdi32" _
(ByVal hDestDC As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" _
(ByVal hdc As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" _
(ByVal lDC As Long) As Long
Private Declare Function CombineTransform Lib "gdi32" ( _
lpxformResult As XForm, lpxform1 As XForm, _
lpxform2 As XForm) As Long
Private Declare Function SetWorldTransform Lib "gdi32" ( _
ByVal hdc As Long, ByRef lpXform As XForm) As Long
Private Declare Function SetGraphicsMode Lib "gdi32" ( _
ByVal hdc As Long, ByVal iMode As Long) As Long
Private Declare Function GetWorldTransform Lib "gdi32" ( _
ByVal hdc As Long, ByRef lpXform As XForm) As Long
Private Declare Function SetViewportOrgEx Lib "gdi32" ( _
ByVal hdc As Long, ByVal nX As Long, ByVal nY As Long, _
ByRef lpPoint As Any) As Long
Private Declare Function Ellipse Lib "gdi32" ( _
ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SelectObject Lib "gdi32" ( _
ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" ( _
ByVal nIndex As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" ( _
ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _
ByRef lpPoint As Any) As Long
Private Declare Function LineTo Lib "gdi32" ( _
ByVal hdc As Long, ByVal x As Long, _
ByVal y As Long) As Long
Private Declare Function GetSysColor Lib "user32" ( _
ByVal nIndex As Long) As Long
Private Declare Function CreatePen Lib "gdi32" ( _
ByVal nPenStyle As Long, ByVal nWidth As Long, _
ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" ( _
ByVal hObject As Long) As Long
Private Declare Function Polygon Lib "gdi32" _
(ByVal hdc As Long, lpPoint As PointAPI, _
ByVal nCount As Long) As Long

Private Declare Function CreatePolygonRgn Lib "gdi32" _
(lpPoint As PointAPI, ByVal nCount As Long, _
ByVal nPolyFillMode As Long) As Long
Private Type XForm
eM11 As Single
eM12 As Single
eM21 As Single
eM22 As Single
eDx As Single
eDy As Single
End Type
Dim CenterPoint As Single
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type PointAPI
x As Long
y As Long
End Type
Private RotAmt As Single
Const Pi As Single = 3.14159
Private RotRad As Single
Private Const GM_ADVANCED As Long = &H2
Private Const COLOR_BTNSHADOW As Long = &H10
Private Const NULL_BRUSH As Long = &H5
Private Const BLACK_PEN As Long = &H7
Private Const PS_DOT As Long = &H2
Private Const PS_SOLID As Long = &H0

Private Sub Command1_Click()
Picture1.Cls
RotAmt = RotAmt + 5
RotRad = (RotAmt / 180) * Pi
If RotAmt <= 90 Or RotAmt >= 270 Then
CreatePanelDC
CreateDoorDC
Else
CreateDoorDC
CreatePanelDC
End If
End Sub
Private Sub Command2_Click()
Picture1.Cls
RotAmt = RotAmt - 5
RotRad = (RotAmt / 180) * Pi
If RotAmt <= 90 Or RotAmt >= 270 Then
CreatePanelDC
CreateDoorDC
Else
CreateDoorDC
CreatePanelDC
End If
End Sub
Private Function CreateDoorDC() As Long
Dim TransMatrix As XForm
Dim OldMatrix As XForm
Dim OldMode As Long
Dim OldBrush As Long, OldPen As Long
Dim OldOrg As PointAPI
Dim EdgePens As Long
Dim i As Integer
' Create z-axis transformation matrix
With TransMatrix
.eM11 = Cos(RotRad)
.eM12 = Sin(RotRad)
.eM21 = 0 '-Sin(RotRad)
.eM22 = 1 'Cos(RotRad)
.eDx = 325 - Cos(RotRad) * 325 + Sin(RotRad) * 0
.eDy = 0 - Cos(RotRad) * 0 - Sin(RotRad) * 325
End With
' Set the graphics mode to advanced mode
OldMode = SetGraphicsMode(Picture1.hdc, GM_ADVANCED)
' Create pens (edges)
EdgePens = CreatePen(PS_SOLID, 1, vbBlack)
' Disable brush (fill), and set dotted 'faded' pen
OldBrush = SelectObject(Picture1.hdc, GetStockObject(NULL_BRUSH))
' Select black pen
Call SelectObject(Picture1.hdc, EdgePens)
' Get the current transformation matrix and set new one
Call GetWorldTransform(Picture1.hdc, OldMatrix)
Call SetWorldTransform(Picture1.hdc, TransMatrix)
' Draw the transformed geometry
'------------------------------------------------------------------------

DrawSquare Picture1.hdc, 250, 250

'------------------------------------------------------------------------
' Clean up
Call SetViewportOrgEx(Picture1.hdc, OldOrg.x, OldOrg.y, ByVal 0&)
Call SetWorldTransform(Picture1.hdc, OldMatrix)
Call SetGraphicsMode(Picture1.hdc, OldMode)
Call SelectObject(Picture1.hdc, OldBrush)
Call SelectObject(Picture1.hdc, OldPen)
Call DeleteObject(EdgePens)
End Function
Private Function CreatePanelDC() As Long
Dim TransMatrix1 As XForm, TransMatrix2 As XForm
Dim OldMatrix As XForm
Dim OldMode As Long
Dim OldBrush As Long, OldPen As Long
Dim OldOrg As PointAPI
Dim EdgePens As Long
Dim i As Integer
Dim sngAngle As Single
Dim sngRad As Single
sngAngle = 45
sngRad = (sngAngle / 180) * Pi
With TransMatrix1
.eM11 = Cos(RotRad + sngRad)
.eM12 = Sin(RotRad + sngRad)
.eM21 = 0
.eM22 = 1
.eDx = 325 - Cos(RotRad + sngRad) * 325 + Sin(RotRad + sngRad) * 0
.eDy = 0 - Cos(RotRad + sngRad) * 0 - Sin(RotRad + sngRad) * 325
End With



' CombineTransform TransMatrix1, TransMatrix1, TransMatrix2
' Set the graphics mode to advanced mode
OldMode = SetGraphicsMode(Picture1.hdc, GM_ADVANCED)
' Create pens (edges)
EdgePens = CreatePen(PS_SOLID, 1, vbBlack)
' Disable brush (fill), and set dotted 'faded' pen
OldBrush = SelectObject(Picture1.hdc, GetStockObject(NULL_BRUSH))
' Select black pen
Call SelectObject(Picture1.hdc, EdgePens)
' Get the current transformation matrix and set new one
Call GetWorldTransform(Picture1.hdc, OldMatrix)
Call SetWorldTransform(Picture1.hdc, TransMatrix1)

' Draw the transformed geometry
'------------------------------------------------------------------------

DrawSquare Picture1.hdc, 100, 250

'------------------------------------------------------------------------
' Clean up
Call SetViewportOrgEx(Picture1.hdc, OldOrg.x, OldOrg.y, ByVal 0&)
Call SetWorldTransform(Picture1.hdc, OldMatrix)
Call SetGraphicsMode(Picture1.hdc, OldMode)
Call SelectObject(Picture1.hdc, OldBrush)
Call SelectObject(Picture1.hdc, OldPen)
Call DeleteObject(EdgePens)
End Function
Private Sub DrawSquare(hdc As Long, lngLeftX As Long, lngTopY As Long)
Dim hBrush As Long, hRgn As Long
Dim mBrush As Long
mBrush = CreateSolidBrush(&HFFFFD0)
SelectObject hdc, mBrush
Dim poly(1 To 4) As PointAPI
hRgn = CreatePolygonRgn(poly(1), 4, 1)
DeleteObject hRgn
poly(1).x = lngLeftX
poly(1).y = lngTopY
poly(2).x = lngLeftX
poly(2).y = lngTopY + 150
poly(3).x = lngLeftX + 150
poly(3).y = lngTopY + 150
poly(4).x = lngLeftX + 150
poly(4).y = lngTopY
SelectObject hdc, mBrush
Polygon hdc, poly(1), 4
hRgn = CreatePolygonRgn(poly(1), 4, 1)
DeleteObject mBrush
DeleteObject hRgn
End Sub

Private Sub Command3_Click()
If Timer1.Enabled = True Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub

Private Sub Timer1_Timer()
Picture1.Cls
RotAmt = RotAmt + 5
RotRad = (RotAmt / 180) * Pi
If RotAmt <= 90 Or RotAmt >= 270 Then
CreatePanelDC
CreateDoorDC
Else
CreateDoorDC
CreatePanelDC
End If
End Sub

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
To be honest, I think I'd be playing with DirectX to do this...
 
I was really hoping you would say adjust .eDx and .eDy formulas like so and then you're done, but your probably right. I'm wondering if I really need DirectX I'm thinking of just storing X, y and Z cooridantates doing the math and then drawing Polygons to a dc. Should be fast enough, you think.

I thought I really had something here. Draw the polygon, rotate it accordingly and then put it in it's right place.

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
Problem is that SetWordTransform only does a 2D transfomation - so applying it to a scene where the constituent objects (your polygons) conceptually lie in more than one plane will distort (and not correctly visually rotate) at least one of the planes. So it doesn't seem to me to be an ideal way to do 3D graphics - but somebody may be along shortly to demonstrate that I'm wrong.
 
In fact, come to think of it, many people seem to back of from DirectX because they think it must be hard. In general it isn't. In fact doing the basic 3D is generally simpler than figuring out the SetWorldTransForm stuff for 3D transformations in GDI. SO I thought I'd just drop in a DirectX8 example here that does something similar to DrJava's code. For the example you'll need a form with a command button, and to add a reference to the &quot;DirectX 8 for Visual Basic Tyle Library&quot;:
[tt]
Option Explicit

' Untransformed, lit vertex type. Means we can do 3d stuff
Private Type CUSTOMVERTEX
x As Single
y As Single
z As Single
color As Long ' vertex color.
Specular As Long ' We won't use since only doing simple color and lighting
tu As Single ' We won't use since only doing simple color and lighting
tv As Single ' We won't use since only doing simple color and lighting
End Type

Const D3DFVF_CUSTOMVERTEX = (D3DFVF_XYZ Or D3DFVF_DIFFUSE Or D3DFVF_SPECULAR Or D3DFVF_TEX1)
Const pi = 3.14159616
Const Rad = pi / 180
' And yes, that's it. No other declarations...

Private Sub Command1_Click()
Dim Vertices(36) As CUSTOMVERTEX ' Enough for a cube, but we'll only illustrate two panels as per DrJavaJo
Dim DirectX As DirectX8
Dim D8 As Direct3D8
Dim DXDevice As Direct3DDevice8
Dim Mode As D3DDISPLAYMODE
Dim d3dpp As D3DPRESENT_PARAMETERS
Dim VBuff As Direct3DVertexBuffer8

' Matrices we will need
Dim matWorld As DxVBLibA.D3DMATRIX
Dim matWorldX As DxVBLibA.D3DMATRIX
Dim matWorldY As DxVBLibA.D3DMATRIX
Dim matWorldZ As DxVBLibA.D3DMATRIX
Dim matView As DxVBLibA.D3DMATRIX

' Viewing vectors
Dim vecEye As DxVBLibA.D3DVECTOR
Dim vecAt As DxVBLibA.D3DVECTOR
Dim vecUp As DxVBLibA.D3DVECTOR

Dim lp As Long

' OK, core DirectX8 setup
Set DirectX = New DirectX8
Set D8 = DirectX.Direct3DCreate
' Done! So much easier than DirectX7

' OK, set up our backbuffer properly
D8.GetAdapterDisplayMode D3DADAPTER_DEFAULT, Mode
d3dpp.Windowed = 1 'C++ True
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC
d3dpp.BackBufferFormat = Mode.Format
d3dpp.AutoDepthStencilFormat = D3DFMT_D24X8 ' D3DFMT_D16 ' may need to choose this latter format depending on graphics card
d3dpp.EnableAutoDepthStencil = 1 'C++ True
Set DXDevice = D8.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Form1.hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, d3dpp)
' Hurrah., Backbuffer all ready now

' Select some simple rendering modes
DXDevice.SetRenderState D3DRS_LIGHTING, False ' We're using simple lighting
DXDevice.SetRenderState D3DRS_ZENABLE, 1 ' Need Z buffer enabled
DXDevice.SetRenderState D3DRS_CULLMODE, D3DCULL_NONE ' Don't cull triangles (means we can see front and back of them)

' Set type of vertex shader (without this nothing will render)
DXDevice.SetVertexShader D3DFVF_CUSTOMVERTEX

' OK - build the two panels using vertices (DirectX prefers them...)
' We'll be using triangles as primitives, so each panel is made up of two triangles, which
' is 4 vertices
With Vertices(0): .x = -1: .y = 1: .z = 1: .color = &HFF0000: End With
With Vertices(1): .x = 1: .y = 1: .z = 1: .color = &HFF00: End With
With Vertices(2): .x = -1: .y = -1: .z = 1: .color = &HFF: End With
With Vertices(3): .x = 1: .y = -1: .z = 1: .color = &HFFFF: End With

With Vertices(4): .x = 0: .y = 1: .z = 0.5: .color = &HD0FFFF: End With
With Vertices(5): .x = 0: .y = 1: .z = -1.5: .color = &HD0FFFF: End With
With Vertices(6): .x = 0: .y = -1: .z = 0.5: .color = &HD0FFFF: End With
With Vertices(7): .x = 0: .y = -1: .z = -1.5: .color = &HD0FFFF: End With
' All done...

' Only bother doing these two lines if we want to draw straight from a vertex buffer
' Kept here for sake of illustration
'Set VBuff = DXDevice.CreateVertexBuffer(LenB(Vertices(0)) * 8, 0, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT)
'D3DVertexBuffer8SetData VBuff, 0, LenB(Vertices(0)) * 8, 0, Vertices(0)
'DXDevice.SetStreamSource 0, VBuff, LenB(Vertices(0))

' OK, tell DirectX we want a 2D perspective view of our 3D object
D3DXMatrixPerspectiveFovLH matView, pi / 4, 1#, 0.1, 75
DXDevice.SetTransform D3DTS_PROJECTION, matView

' Set up our camera
With vecEye: .x = 1: .y = 5: .z = 5: End With ' looking from
With vecAt: .x = 0#: .y = 0#: .z = 0#: End With ' looking towards
With vecUp: .x = 0#: .y = 1#: .z = 0#: End With ' which vector is up
D3DXMatrixLookAtLH matView, vecEye, vecAt, vecUp
DXDevice.SetTransform D3DTS_VIEW, matView

' Rotate...
For lp = 0 To 360 Step 2

' Clear the backbuffer
DXDevice.Clear 0&, ByVal 0&, D3DCLEAR_TARGET Or D3DCLEAR_ZBUFFER, &HC0C0C0, 1#, 0


' Set up rotations for world transform matrices. Much easier than GDI's SetWorldTransform, as
' DirectX does the calculations for us; we just need to feed it the rotation angle (in Radians)
D3DXMatrixRotationX matWorldX, 0
D3DXMatrixRotationY matWorldY, Rad * lp ' We're only rotating around Y axis for this example
D3DXMatrixRotationZ matWorldZ, 0

' 'Combine the transformations by multiplying them together
D3DXMatrixMultiply matWorld, matWorldX, matWorldY
D3DXMatrixMultiply matWorld, matWorld, matWorldZ
DXDevice.SetTransform D3DTS_WORLD, matWorld

DXDevice.BeginScene
DXDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertices(0), LenB(Vertices(0))
DXDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertices(4), LenB(Vertices(0))

' Alternatively: rendering from vertex buffer if we've set one up
'DXDevice.DrawPrimitive D3DPT_TRIANGLESTRIP, 0, 2
'DXDevice.DrawPrimitive D3DPT_TRIANGLESTRIP, 4, 2

DXDevice.EndScene
DXDevice.Present ByVal 0&, ByVal 0&, 0&, ByVal 0& ' Ok, flip primary and backbuffer over
Next

' Clean up
Set DXDevice = Nothing
Set D8 = Nothing
Set DirectX = Nothing

End Sub
 
hmm, I've been playing around with this code which seems to make doing 3-d stuff easier, but some of the basic drawing aspects are not as intuitive, lines, circles etc. I do like the lighting options but again not real intuitive. One thing I would like to be able to do is write the object to a metafile but the only way I see immediately is to draw this in a picturebox then blit the image to the Metafile dc, is there a way to write directly to a Device Context? Thanks for the example.

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
Lighting? I hope you are not using my example as one with decent lighting - as it doesn't contain any! The colourful panel in the example is just a result of the fact that I used different colors on each corner for the plain texture, which DirectX kindly merges for us; it isn't lighting. Simple lighting in DirectX 8 is pretty similar to the camera: place it somewhere in the world, face it in a particular direction. Bingo, lighting done.

Lines are pretty easy, doing a DrawPrimitive with a D3DPT_LINESTRIP. Circles are trickier, but can be faked with enough LINESTRIPS...

But you are right, there's no easy way to get the results straight into an anhanced metafile

 
good code as ever but i keep getting an automation error on the line

Set DXDevice = D8.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Form1.hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, d3dpp)

any ideas?

thnx

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
To get the best response to a question, please check out FAQ222-2244 first
A General Guide To Excel in VB FAQ222-3383
 
Change
D3DCREATE_HARDWARE_VERTEXPROCESSING
to
D3DCREATE_SOFTWARE_VERTEXPROCESSING
There is a way of testing to see if the Hardware is sufficient to use D3DCREATE_HARDWARE_VERTEXPROCESSING but I don't have the example here.

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
As far as the lighting I grabbed an example from PSC and combined it with this example, and I am liking the results so far.

My dilemma is this I’m am trying to build a unit that will have 1 door and up to 4 additional panels that are either inline or between 45 and 135 degrees off of the door or the panel preceding the panel. Each panel can be full height, less than full height with the top matching or have a rectangle notched out of it. I will need to draw handles or towel bars representations on each panel if necessary. So where the panels come together I need to draw a line or a representation of the metal that connects the two and this will have to rotate with the unit. Also the measurements have to be somewhat to scale a 4 inch panel cannot be wider than a 36 inch door, etc. Now this will be built by the user by choosing various options and as they build it the picture will be displayed in a picture box. When it is all finished the user clicks save and the data is stored in a DB and then when viewing the report, Crystal Report, a small thumbnail size image of the unit is displayed, which is created by calling the same function. This function then creates an emf that is used to display on the report, after which the image gets destroyed. I am currently doing something very similar which displays glass with special hinge cutouts on it. I do this using the gdi32 library. Well this brings me to my dilemma would it be easier to do this using the GDI stuff again or Directx with all of it’s bells and whistles. I’m thinking the best approach would be to draw each panel using gdi into a device context and then load these into the directx surfaces if that is even possible, then rotate the unit as a whole. Any hints on the best approach would be greatly appreciated.


&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
same error, same line :(

r-t error -2005530516 (8876086c)

help links me to &quot;Form Window&quot; in MSDN

thnx

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
To get the best response to a question, please check out FAQ222-2244 first
A General Guide To Excel in VB FAQ222-3383
 
Dim DXError As New D3DX8
Debug.Print DXError.GetErrorString(-2005530516)

Will return an error description and it returns D3DERR_INVALIDCALL which isn't much help, but mught turn up a better google search. I would play around with d3dpp parameters. I was getting the same error this morning and making the change above is what solved my problem. What operating system are you running it on?

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
will give it a try tomorrow (4:49am now)

OS is 2k pro all latest service packs etc

thnx

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
To get the best response to a question, please check out FAQ222-2244 first
A General Guide To Excel in VB FAQ222-3383
 
DrJavaJoe started pointing you in the right direction with D3DCREATE_SOFTWARE_VERTEXPROCESSING.

The basic issue is the capability of your graphics card (rather than your OS or it's patch revision). In the short term, try commenting out

EnableAutoDepthStencil = 1

to disable the hardware depth buffer. Unfortunately, this will result in drawing artifacts but at least should allow you to see the program in action.

 
Or, of course, it may simply be that your card doesn't support a 32-bit depth buffer, in which case try changing

d3dpp.AutoDepthStencilFormat = D3DFMT_D24X8

for the commented out

d3dpp.AutoDepthStencilFormat = D3DFMT_D16

(and reenable the the AutoDepthStencil...)
 
thanx strongm i did try the D3DFMT_D16 instead of the 32 but not in conjuction with 3DCREATE_SOFTWARE_VERTEXPROCESSING

will give it a try when i get home.

i will also check the spec on the graphics card.

thnx

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
To get the best response to a question, please check out FAQ222-2244 first
A General Guide To Excel in VB FAQ222-3383
 
OK, I've tested it on a W2k box with an old 64K NVidia Riva TNT2 card, which requires D3DFMT-16, SOFTWARE_VERTEXPROCESSING, and disabling of the DepthStencil
 
result.

EnableAutoDepthStencil=0 and SOFTWARE did the trick.

thanx guys

time for me to find a project i can use it on now :D

(o and stars all around)

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
To get the best response to a question, please check out FAQ222-2244 first
A General Guide To Excel in VB FAQ222-3383
 
I guess I just needed a good night sleep I came in this morning and everything started to make sense. Thanks for the pointers strongm.

by the way I found a good tutorial website to checkout if anyone is interested:

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
strongm, I justed wanted to say thanks again for pointing me in the direction of Directx 8. I've played with version 7 before but nothing to this extent. It took me longer than I wanted to get this procedure done but the quality of the output has made it well worth it. After a week of tinkering I now look back and cannot believe how easy it is to use. My intention when I started was to build a simple almost stick like 3d view of shower enclosures and now I've decided to add Textures such as Marble Tiles and Metal Frames. Hell my boss is impressed. Thanks.

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top