I can probably help. What do you need?
Yo.
I need some help with some world to screen calculations. If possible, using the least amount of API possible, having a couple wouldn't be a big deal but it'd be preferable if there was none.
So.. if any of you mathematicians want to help me out here..
Thanks.
Note: All though I program a lot, I'm not that great in math...
Last edited by Void; 06-21-2010 at 02:54 AM.
I can probably help. What do you need?
Assembly Programmer
therofl (11-02-2010)
I haven't done any world to screen before. Sorry. What does it involve though?
Assembly Programmer
therofl (11-02-2010)
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
therofl (11-02-2010)
Nevermind then.
Assembly Programmer
Found this around the web..A much simpler solution than the perspective projection suggested in the
comment below, and arguably a more attractive one, is the orthographic
projection. I shall give you the formulas to convert (x, y, z) coordinates
into (x, y) coordinates after rotation about the axes.
Suppose that we rotate the cube by Rx degrees about the x axis, by Ry
degrees about the y axis, and by Rz degrees about the z axis.
First, apply the x-axis rotation to transform coordinates (x, y, z)
into coordinates (x0, y0, z0).
x0 = x
y0 = y*cos(Rx) + z*sin(Rx)
z0 = z*cos(Rx) - y*sin(Rx)
Then apply the y-axis rotation to (x0, y0, z0) to obtain (x1, y1, z1).
x1 = x0*cos(Ry) - z0*sin(Ry)
y1 = y0
z1 = z0*cos(Ry) + x0*sin(Ry)
Finally, apply the z-axis rotation to obtain the point (x2, y2).
x2 = x1*cos(Rz) + y1*sin(Rz)
y2 = y1*cos(Rz) - x1*sin(Rz)
Hey presto, you can now plot (x2, y2) in two dimensions.
Regards,
leapinglizard
Original: Google Answers: conversion of XYZ coordinates to XY
not sure if is that what you are looking for. Not that good with maths either. (Googled..)
Light travels faster than sound. That's why most people seem bright until you hear them speak.
Void (06-21-2010)
It just so happens that's what we've been doing in maths this year (I'm failing it but we'll overlook that /)
Hmmm, well the only annoying thing is the (z) axis, but that's not too big of a deal if you can find angles and use sine/cosine to get lengths and shizniz. Sorry I can't help you right now it's 12:45AM and my brain just won't function properly, I'll look at it again tomorrow after I've thought about it some more, don't worry I won't forget. If I can be bothered I might be able to find a way to create a VB.NET program that receives x,y,z world co-ords and outputs x,y screen co-ords. I'll probably need to ask you a few questions about world co-ords first though (haven't ever done anything with them), but I'll save that for tomorrow.
Sorry again that I can't help you right this second :S
EDIT: Pwnt by Brinuz
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)