Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


totesmagotes

Member Since 20 Nov 2011
Offline Last Active Yesterday, 10:23 AM

Posts I've Made

In Topic: Converting between coordinate systems

19 February 2015 - 01:01 PM

Hummm... turns out the documentation I had was wrong, and both coordinate systems were already left-handed, with same axes and everything. My problems was with the aspect ratio. If you ever do viewPort.Width/viewPort.Height to get the aspect ratio, you're doing it wrong! Int/Int gives an int.

Better to do:

float(viewPort.Width)/float(viewPort.Height)

In Topic: Converting between coordinate systems

18 February 2015 - 01:12 PM

I just found out that the 2nd coordinate system is probably wrong: I should just go with what Microsoft gives on Direct3D9. I'm concerned with converting from the first coordinate system to Direct3D9's left-handed system. Also, according to the document I have, Yaw goes CCW, Roll: CW, and pitch: CCW, for the 1st system.

 

I'm not actually drawing any triangles with this, just little X's (2 lines) in 2D coordinates on the screen, so I guess I don't need to change the winding order? For more background, the idea is to take points in 3D space and transform them into screen space, marking an X where the player's shots landed. I can't do it in a more direct fashion, since I don't have access to the source code of the engine we're working with, but I can call functions and draw on top of what's already there.

 

Using left-handed view and perspective matrices, I've had limited success; the Y (by Y, I'm referring to 2D screen coordinates: up/down on the screen) seems to be right, but the 2D X-coord (left/right) is off, and as soon as I look left or right, they move way more than they should.(like, if you look left, its normal that the vertices will move further to the right on the screen, but this is way too much). Oddly enough, no anomolous behaviour when looking up and down. I'm using left-handed view and perspective matrices.

 


If pitch is represented by a rotation on X, then a positive 90 pitch should rotate your yaw axis(y) onto your roll axis(z)

 

Z was the yaw axis for both the systems I gave. Are you saying I should concatenate my view matrix with some rotation matrices, in order to rotate the axes? So since Y is yaw in D3D, but in this system, Z is yaw, that means I should do a rotation on the X-axis 90 degrees so that Y lines up with where Z used to be? Also multiply Z coordinates by -1 (is that what you mean by: "mirror"?). Since I'm not working with models, but with points, do I need to bother with yaw/pitch/roll?

 


However, you may need to remap your yaw and pitch and roll angles to the proper axii.

How do I do that?


In Topic: Installing an app permanently on a device

25 May 2012 - 10:11 AM

version 4.0.3, its a zenithink 7" U-Pad.

OK, that's pretty cool that the app stays and keeps running after I unplug the USB, but as soon as I exit the app, I can't get back into it (on that device) without plugging the device back in and running eclipse again. Is there any way to get it to stay there permanently? Like, so it shows up as an Icon in home, that I can press to run it any time later? Or do you have to publish it to the Android app store?

In Topic: Android & Java language question

07 May 2012 - 02:33 PM

OK, so turns out this is an anonymous inner class.

In Topic: projecting 3D coordinates to 2D screen coordinates

21 November 2011 - 11:57 AM

Ok, I see what I was doing wrong. I was testing against the top-left corner when debugging, but the squares were actually being instantiated from bottom-top.

PARTNERS