translation question
translation question
translation question
translation question
translation question
translation question translation question translation question translation question translation question translation question translation question translation question
translation question translation question
translation question
Go Back  Xtreme Visual Basic Talk > > > > translation question


Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2009, 03:05 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Question translation question


I am trying to move my camera view using the translation method but when I do it I get wierd results. Basically everytime I press the W key this code is run

device.Transform.View = Matrix.Translation(0, 0, 10)

problem is it only moves the view to that position , but I want to move the camera foward 10 units everytime I press the key not to the (0,0,10) position. I had a previous project some years ago where I had done this but I can't remember exactly what I did I just remember it being close to this. Any help would be greatly appreciated.
Reply With Quote
  #2  
Old 03-14-2009, 03:09 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default

nvm I solved it I found some of my old code

device.Transform.View = Matrix.Multiply(device.Transform.View, Matrix.Translation(0, 0, 10))
Reply With Quote
  #3  
Old 03-22-2009, 09:45 AM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Default

Not sure what that will do, but it looks wrong.

try this..

Code:
Vector3 LookAt            //Where the camera is looking
Vector3 POSITION        //Erm....... guess what this is for :p 
Matrix CMT                  //The result

CMT = Matrix.LookAtLH(POSITION, LookAt, new Vector3(0, 1, 0));
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
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
translation question
translation question
translation question translation question
translation question
translation question
translation question translation question translation question translation question translation question translation question translation question
translation question
translation question
 
translation question
translation question
 
-->