Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 18th, 2007, 09:14 PM
FoDDa FoDDa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 1 FoDDa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 57 sec
Reputation Power: 0
Unhappy Help needed with First Person Camera issues!

Hi everybody, new to the board and hoping someone can help! lol

Since i finished my computer games degree, i've been working on creating a simple 3d engine in Flash of all things. So far everything is going ok, it will render polygons, perform backface culling, has a cutoff point for rendering (to prevent showing objects behind the camera) and has basic first person camera controls.

At current, the camera's movement is faked somewhat. When the user "moves" the coordinates of each vertices are updated with the amount of movement in each direction.

The camera so far will move forwards backwards, strafe and let the user turn left and right. The issue i'm having is with looking up and down.

When I rotate the current map (although map is a very loose term!) along the X axis to simulate up and down viewing, it does not rotate correctly when pressing left and right. I've uploaded the applet to a web address

olilittle.batcave.net/firstperson.swf

Theres a debug menu on the top left of the applet but it's pretty irellevant lol. The controls are pretty normal, wasd for movement and arrows for looking. Try looking up or down then left or right and you'll see my problem.

Here's a snippet of code i'm using to deal with point rotation

var angleY:Number = spinVelX * .001;
var cosY:Number = Math.cos(angleY);
var sinY:Number = Math.sin(angleY);

var angleX:Number = spinVelY * .001;
var cosX:Number = Math.cos(angleX);
var sinX:Number = Math.sin(angleX);

var z1:Number = point.z * cosY + point.x * sinY;
var y1:Number = point.y * cosX - z1 * sinX;
var x1:Number = point.x * cosY - point.z * sinY;
var z2:Number = z1 * cosX + point.y * sinX;


If anybody has got any ideas i'd be incredibly grateful to hear them, this has been bugging me for quite some time now and it's driving me mad!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > Help needed with First Person Camera issues!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway