Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

python - Math formula for first person 3d game -


i want make first person 3d game can't set camera formula right.

so have rotation: 0 359. next x,y coordinates, z remains same.

camera rotation : 0 - front, 90 - left, 180 - back, 270 - right can adapt it

what formula camera ?

platform: panda3d, python, opengl

thank you

ok, looks need doom style camera movement, i.e., no up-down turns. consider this:

  1. you need render "world" seen through camera.
  2. assuming positive x right , positive y front, when camera moves right world's image moves left.
  3. when camera turns positively left, world's image turns right.

now, let's try construct equations:

1.first, translate world coordinates camera's position:

xwt = xw - xc; ywt = yw - yc; zwt = zw;  (xc,yc,zc) = camera position (xw,yw,zw) = world coordinates of object in scene (xwt,ywt,zwt) = world coordinates of object translated camera position 

2.now, rotate translated coordinates angle opposite camera's rotation:

xwc =  xwt * cos(psi) + ywt * sin(psi); ywc = -xwt * sin(psi) + ywt * cos(psi); zwc =  zwt  psi = angle of camera rotation (xwc,ywc,zwc) = world coordinates of object transformed camera orientation 

you can combine 2 steps , transform matrix form.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -