Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > DirectX > Need to render static graphics and dynamic graphic at the same time


Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2003, 12:21 PM
Teamz Teamz is offline
Newcomer
 
Join Date: Feb 2003
Location: Quebec->Montreal
Posts: 9
Default Need to render static graphics and dynamic graphic at the same time


Here's my problem :

I need to render a 3D model and I need to render 2D buttons that I have created at the same time.

When the user click on one of the buttons, it will do something like rotate the 3D model or resize it, etc.. but the buttons also rotate and I don't want the 2D buttons to rotate. I want the buttons to be static.

I have absolutetly no idea how to do this, anyone can give me any hint plz?
Reply With Quote
  #2  
Old 04-08-2003, 01:53 PM
Incan's Avatar
Incan Incan is offline
Regular
 
Join Date: Dec 2002
Posts: 61
Default

Quote:
Originally Posted by Teamz
I need to render a 3D model and I need to render 2D buttons that I have created at the same time.

When the user click on one of the buttons, it will do something like rotate the 3D model or resize it, etc.. but the buttons also rotate and I don't want the 2D buttons to rotate. I want the buttons to be static.



I'm taking a guess that you haven't decided what to use to accomplish your task so i'd say you'll need to use directx 8 with VB6 or if you are using VB.NET then DirectX9 is the way to go.. its not easier to start with directx 7 then do 8, then 9 etc.. you'll be much better off just jumping in at the most recent version available to you

DirectX is one of the most complicated API's you can use with VB, learning how to use it is not a simple task. Check out http://www.directx4vb.com/, studying the tutorials there will get you started. Also search the forums here, gamedev.net, google. There are a lot of pieces of info around.. although most of the advanced stuff is in C++ but the directX calls are quite easy to pick out and translate to VB pretty easily. Most importantly, read and become familiar with the DirectX SDK documentation.

The model i would create in a 3d package and save in microsoft's .x file format (Milkshape3D is good one, 30day trial and amazingly cheap too with a large base of plugins). there are directx 'helper' functions to load .x files into your application directly. I would use the D3DXSprite class for the 2d buttons...

DirectX is not for the faint hearted or for the beginner programmer and an understanding of 3D concepts is useful.. be prepared for a long term learning project and things may not make a lot of sense until you get your head around it. But, once you do start getting comfortable with the way it all works, the possibilities are immense
__________________
Everything should be as simple as possible - but not simpler. (Albert Einstein)
Reply With Quote
  #3  
Old 04-08-2003, 02:24 PM
Teamz Teamz is offline
Newcomer
 
Join Date: Feb 2003
Location: Quebec->Montreal
Posts: 9
Default

My project is started, as I said in my previous post, when I click on my 2D button to resize or rotate my 3D model, both the model AND the buttons are resized/rotated.

I want to be able to resize/rotate ONLY the 3D model, not the buttons.
Reply With Quote
  #4  
Old 04-08-2003, 02:40 PM
AtonalPanic AtonalPanic is offline
Contributor
 
Join Date: Jul 2002
Location: Houston, Texas
Posts: 445
Default

Try posting some code, otherwise it will be pretty hard to tell you the problem.
Reply With Quote
  #5  
Old 04-08-2003, 02:48 PM
Teamz Teamz is offline
Newcomer
 
Join Date: Feb 2003
Location: Quebec->Montreal
Posts: 9
Default

Pasting some code?

it's not a bug

my buttons are 2 triangles that forms a square. I apply a texture to this square and I'm using DirectInput.

my 3D model is a mesh

this is my matrix code to rotate/resize

Private Sub SetupMatrices()
Dim matTrans As Matrix = Nothing
Dim matRot As Matrix = Nothing
Dim matFinal As Matrix = Nothing
Dim matScale As Matrix = Nothing

Dim matWorld As Matrix = Matrix.Translation(New Vector3(0.0F, 0.0F, 0.0F))

If RenderSettings.type = eDisplayType.type3D Then
Select Case RotationType
Case "Horizontale"
matRot = Matrix.RotationX((Environment.TickCount / 3000.0F))
matWorld.Multiply(matRot)
Case "Verticale"
matRot = Matrix.RotationY((Environment.TickCount / 3000.0F))
matWorld.Multiply(matRot)
Case Else
End Select

If scale.doScale Then
matWorld.Multiply(Matrix.Scaling(scale.x, scale.y, 0))
End If

DisplayDevice.Transform.World = matWorld
End If

'device.Transform.View = Matrix.LookAtLH(New Vector3(0.0F, 3.0F, -5.0F), New Vector3(0.0F, 0.0F, 0.0F), New Vector3(0.0F, 1.0F, 0.0F))
DisplayDevice.Transform.View = Matrix.LookAtLH(New Vector3(0.0F, 0.0F, 5.0F), New Vector3(0.0F, 0.0F, 0.0F), New Vector3(0.0F, 1.0F, 0.0F))
'DisplayDevice.Transform.View = Matrix.LookAtLH(New Vector3(0.0F, 0.0F, 5.0F), New Vector3(0.0F, 0.0F, 0.0F), New Vector3(0.0F, 0.0F, 0.0F))

If RenderSettings.type = eDisplayType.type2D Then
DisplayDevice.Transform.Projection = Matrix.OrthoLH(MainWindow.ClientSize.Width, MainWindow.ClientSize.Height, 0, 100)
Else
DisplayDevice.Transform.Projection = Matrix.PerspectiveFovLH(CSng(Math.PI) / 2.0F, 1.0F, 1.0F, 500.0F)
End If
End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->