# ArchangelMorph

Member

543

263 Neutral

• Rank
1. ## Constructing a picking ray from 2D position

I have a problem.. I've been working on trying to get my picking algorithm to work for an age now with no luck.. I'm trying to figure out the math necessary to create a picking ray (e.g. rayStart, rayEnd) from 2D screen coordinates. I've tried a few methods so far & every single one has pretty much failed to generate reasonable values.. Here's the current state of my code..:- void ScreenToWorldRay( Point2& screenpos, Vector3* rayStart, Vector3* rayEnd ) { F32 fNear = 0.1f; F32 fFar = 5000.0f; F32 fWidth = GetCanvas()->GetWidth(); F32 fHeight = GetCanvas()->GetHeight(); Vector3 pos; pos.setX( (screenpos.X/fWidth)*2 - 1.0f ); pos.setY( 1.0f - (screenpos.Y/(fHeight/2)) ); pos.setZ( 0.0f ); Vector3 camPos = GetCameraPosition(); Matrix4 mw = Matrix4::Translation( camPos ); Matrix4 mv = GetTransformMatrix( Matrix_View ); Matrix4 mp = GetTransformMatrix( Matrix_Projection ); Matrix4 inverse = mw * mv; inverse = Matrix4::Inverse( inverse * mp ); Vector4 rs = (inverse * Vector3(pos.X * fNear, pos.Y * fNear, fNear)); Vector4 re = (inverse * Vector3(pos.X * fFar, pos.Y * fFar, fFar)); *rayStart = (rs.getXYZ() / rs.W); *rayEnd = (re.getXYZ() / re.W); } The function seems to generate values of rayStart = { -0.0f; -0.05f; -0.0f } rayEnd = { -0.0f; -0.05f; -0.0f } With a camera position of { 0.0f; 10.0f; 20.0f; } facing the origin.. These values seems incredibly low considering rayStart should be a point on the nearplane (at 0.1f) & rayEnd on the farplane (at 5000.0f) respectively.. I'm not quite sure where it's going wrong here.. Any help you could provide would be very much appreciated.. Cheers
2. ## XNA and the Xbox 360 Tessellator

AFAIK Since XNA is CLR interpreted & isn't running directly through the Hypervisor as native code then there's isn't really any way to get low-level access to things like the tessalator or VMX units unfortunately.
3. ## AABB to AABB collision response/correction help..

Thanks a bunch guys!!
4. ## AABB to AABB collision response/correction help..

I've been trying to get my collision code to work properly for a while now.. so far I managed to get an AABB to trimesh algorithm which works *reasonably* well but for some reason I can't quite put an algorithm together which does AABB to AABB response properly.. I have no problem using Separating Axis Theorem to test if a collision has occured but I need to figure out how to correct the positions of my AABBs.. Please could some one help me deal overlap detection & positional correction between the following sample case:- One static AABB and one AABB moving at a set velocity and colliding with the static one.. This would really help me move along from this issue that has had me bogged down for far too long.. Please help.. :(
5. ## Larrabee @ SIGGRAPH

Quote:Original post by Jason Z One thing that I haven't heard anyone comment on is the fact that by the time that Larrabee comes out we will be up to our necks in DX11. It seems pretty obvious that OpenGL is losing ground daily, and unfortunately DX10 hasn't really picked up quite as much popularity as it should have. These two facts seem to make the success of DX11 a bit more important in the long run. As far as how Larrabee is accepted - it will need to be efficient enough to compete with the other discrete GPUs. Personally, I don't think the first generation is going to keep pace with NV and AMD. However, Intel is a big company and continually improves their manufacturing processes which makes future generations of the chip (with their corresponding increases in real estate) look promising. Of course, this is all somewhat premature since the hardware hasn't even been tested really. I'm sure Intel has something up and running, but there is a lot of time between now and the release of the chip. We'll see where it goes... Larrabee doesn't have to compete with the high-end at all.. If Intel can put something together that's reasonable enough to compete at the mid-range but with the flexibility of a CPU then they could easily plant themselves a nice huge slab of marketshare.. Added to the fact that Intel already OWN the IGP space for PCs I don't see why they couldn't ship 32nm 4-8 core larrabee IGP mobos (with a nice fast bus between the chip & the CPU) of which they could solidify a HUGE market segment, capturing practically ALL of the low-end market. With that kind of penetration I don't see why it wouldn't be profitable for software vendors to target the hardware, even providing more of an incentive for heavily optimized software renderers making DX & GL even less relevant. If Intel can do all of these things and really grab a hold of the low-end IGP & mid-range PCIe markets, it really wouldn't leave much room for the competitors IMO.
6. ## Finding Character Animation

Add a bone in the hand where you'd like to attach the object.. Then when you update the animation, set the position+orientation of the prop to that of the bone.. It might be worth giving the bone name you can use to identify it easily enough in the hierarchy..
7. ## Transforming lines..

I have a unitY length line (setup up so that the origin sits dead at the centre of it..) I want to render.. I'm trying to setup a method which will allow me to specify a start vector & end vector & the LineRenderer object will setup a transformation matrix to pass to the draw function to get my line oriented & scaled into the correct place.. I've tried a few different algorithms but the vector math is frying my brain so I was wondering if someone could help me..? Something like this: class LineRenderer { ... public void Draw(Vector3 start, Vector3 end, Matrix viewproj) { // setup transform matrix Matrix mat = ... ; // draw with transform matrix DrawLine( mat ); } ... }
8. ## [.net] C# Trackbar Control

Thanks for the info.. Any idea how i'd handle doing the drawing of the other assets ontop of the control..? Is there something like wxWidgets' wxClientDC in WinForms (C#)...?
9. ## [.net] C# Trackbar Control

So I've got a trackbar slider in my XNA/winforms editor for use with my custom animation editor suite.. The issue I have is I would like to draw markers/icons on to the trackbar to specify where along the timeline keyframes have been set & also draw text underneath the ticks to specify the time intervals.. I haven't done any custom controls with WinForms before & so I was wondering how I would go about creating a custom trackbar which will allow me to add these specific features to the control..? Any help would be much appreciated! Thanks!
10. ## Crytek: pc gaming not worth it

2 pages of posts when the ideal response to the OP could have been summed up as: "If yer wud'da shipped on Steam then yer wuddun' be in the s*** with yer Crysis sales now wudd'ya..?"
11. ## Touch typing

wtf? no QWERTY?
12. ## Squad-Based Asteroids - Will it work?

To me this soudns like something you really need to prototype.. I'd reccommend slapping up something in XNa for two players & just test how it feels.. It could be possible to make it work really well provided you can get the balance right..
13. ## Baby born with 2 faces...W.T.F!

Over there years there seemed to be a large frequency of genetic defects which originate out of poverty stricken countries like parts of Africa & India.. I would probably put it down to what trapper mentioned about marrying within a small population but also with respect to other influences such as diet, living conditions & sometimes even quality of healthcare.. For example, I know back home in Nigeria there are loads of cases where children are born with genetic defects due to drugs being perscribed to mothers during childbirth, that were either the wrong ones or cheap crap made up by corrupt pharmaceutical companies who thought they could save more money off the drugs they produced by padding them out with junk (flour, chalk etc..) I'm pretty sure this kind of thing happens all over the world too..
14. ## Bill gates need for programmers???

Isn't it a bit rude to call people "Aliens"..?
15. ## so.. i'm not a teenager anymore?

I thought teenage-dom ended at 13? *shrug*