SRL Archive - Test corner

Convert Coord on the MiniMap to a Coord on the Main Screen


Macrosoft

2009-12-25 20:54:43

Nobody steal the idea, im actually gunna do it this time :)

So iv almost fully developed the idea using a lot of complex application of trig to how things are distorted in a 2d view of a 3d space (no way to explain what i see in my head without using a ton of diagrams)

the only thing i need right now is a way to know the elevation of the camera / the angle it is tilted at

What iv gotten so far is that the camera seems to move vertically, and tilt so that the head of the character is centered (at first i thoguht it moved on a sphere with a constant radius from the character, but it seems to be moving straight up).

So i was thinking of using the apparent height of the character to determine the angle the camera is at. The only problem is how do i determine the height of the character if it may have differnt colors. I was thinking finding the color of the ground and finding the blob that is not generally that color, but i was wondering if you guys had any other ideas on how to do this.

Also, if there was a way to find the angle via reflection, that would be really convenient…

Thoughts?
Macrosoft

Wanted

2009-12-25 21:46:12

Just do Highest angle, /or and lowest angle. No need to do anything inbetween.

Macrosoft

2009-12-25 22:08:59

but for the sake of epicness i want to make a function that calculates it

and even for that, i need ot know WHAT the highest and lowest angles are in degrees ot be able to use trig and calculate stuff

though i may be able to use the height difference in the character as it goes from lowest to highest, hold on let me draw a diagram and see if it works

edit: degrees or radians :) sorry if i offended anyone

noidea

2009-12-25 22:40:48

This has been done MANY times ;)

Macrosoft

2009-12-25 23:38:57

WHAT??

link me please

noidea

2009-12-25 23:43:06

http://www.villavu.com/forum/showthread.php?t=53445&highlight=mmToMS

Macrosoft

2009-12-26 00:40:30

ah, but u see mine will be much more complicated

it will incorporate the angle of the camera, which distorts the 2d view of 3d space

noidea

2009-12-26 01:47:47

From: Macrosoft
ah, but u see mine will be much more complicated

it will incorporate the angle of the camera, which distorts the 2d view of 3d space


do it :) stop posting :p

Macrosoft

2009-12-26 02:43:46

in 1 hour im going on vacation for a week and wont have internet

ill just have to draw diagrams and come up with all my equations in that time

(and read the complete works of Edgar Allan Poe for a paper im writing on him for school)

Naike

2009-12-26 06:29:34

There's a function like this in SRL already.

MMToMS in math.scar

Macrosoft

2010-01-01 23:42:27

you has much wrongness N1ke, try reading the thread ;)

marpis

2010-01-02 08:30:03

If you use reflection to get the camera angle you make this whole project needless.
Then you could just use reflection's TileToMS…

Quickmarch

2010-01-03 05:30:43

I can't see any way of doing this without reflection to get the camera's pitch…

Macrosoft

2010-01-03 19:15:21

i plan on taking a square around where the character usually is, and then finding the blob of color which is NOT the most used (like what is not grass or road color, with a tolerance of course)

this blob will be the character. i can use the apparent height of the character to find the angle that the camera is at.

its complicated because the camera moves on a straight line up and down, with it always aimed at the head of the character (i think). So distance also plays a role in the apparent length of the character. i think if figured it out tho…

Wanted

2010-01-03 19:17:10

I still don't understand why you would want anything other than max height and low height.

Macrosoft

2010-01-03 20:18:44

N1ke and i have been battling out who is superior and i feel if i can pull this off it will settle things

also this is some of the most epic math iv ever done…i like math

noidea

2010-01-03 20:36:33

From: Macrosoft
also this is some of the most epic math iv ever done…i like math


post it :) I would like to see some uber-ometry!

Macrosoft

2010-01-03 21:32:27

it would be hard to explain what i have so far without diagrams

when i figure out the equation ill post that and u can try to make sense of it

Edit: aight, i got the equation but i have to go do schoolwork now so ill finish the function later

h=height of camera
r=height of character when camera is at lowest angle
x= apparent height of character currently
A=angle of camera to head
d=constant of the horizontal distance between camera and character

h=r/2 + sqrt((r(d^2)/x)-d^2 + (r^2)/4)

A = arctan((h-r)/d)
i doubt u get that, i would have to explain with diagrams and if i scanned the paper i was working on u would think im crazy so ull just have to wait until i have more time to explain
somehow my trig stuff canceled out in my equation for the height of the camera, which is a little weird

its very likely that i screwed up and made a dumb mistake but i have to do schoolwork now and im tired

Heysus

2010-01-04 20:43:16

if you want it to be accurate you need to find the ground height too.

jimmy_mac

2010-01-05 02:25:19

From: Heysus
if you want it to be accurate you need to find the ground height too.


im pretty sure half of it is about that… and in macrosofts post just before yours. i think its 'H'.

marpis

2010-01-05 07:35:53

From: jimmy_mac
im pretty sure half of it is about that… and in macrosofts post just before yours. i think its 'H'.


Nope, 'h' is height of camera, which is <> ground height

Main

2010-01-05 16:57:54

Can you try to do the opposite? For example my fight cave runner, I am trying to detect the direction of the projectile from the monster to locate the direction they are in, so i can get my self unstuck.

Blumblebee

2010-01-05 19:16:32

From: Main_Ftw
Can you try to do the opposite? For example my fight cave runner, I am trying to detect the direction of the projectile from the monster to locate the direction they are in, so i can get my self unstuck.


if your stuck then your not moving yes? Look for pixel shifting (movement), divide the MM into four sections and deturmine the direction via that. To make things even more simple I'm pretty sure Marpis made an Animation include thingy that you could draw off of/use.