Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Position relative to what?
jorgeas80 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jan 2014
Reputation: 0
#1
Position relative to what?

Hello,

In HPL1Engine, every 3D entity has a defined position (X, Y, Z). My question is: relative to what? Other way: How is the coordinate system defined? If an object is at (0, 0, 0), where is it? Is there a "world" element that defines a coordinate system?

Sorry for the basic question. I don't have experience with 3D programming and videogames. I need to transform the coordinates of the light objects of the game to another coordinate system, and logging their values, I see negative numbers. I don't know what they mean, or how the coordinate system is built
02-20-2014, 08:37 PM
Website Find Reply
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#2
RE: Position relative to what?

If an object is at 0 0 0 it is at the center of the world, which has its own cordinate system, commonly refererred to as either world or global cordinates.
At the very least this is how I have understood.
02-21-2014, 06:41 AM
Find Reply
jorgeas80 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jan 2014
Reputation: 0
#3
RE: Position relative to what?

(02-21-2014, 06:41 AM)The Mug Wrote: If an object is at 0 0 0 it is at the center of the world, which has its own cordinate system, commonly refererred to as either world or global cordinates.
At the very least this is how I have understood.

Thanks for your response. Yes, that was what I thought. In my mind, a "world" is basically the map you're playing on. The coordinate system of that world (map) starts at (0, 0, 0). But is it an arbitrary point? Is the centroid of the polygon defining the XZ plane of the map?

I need to know how this coordinate system is created, because I'm going to transform the coordinates of some elements put in the world (the lights) to another coordinate system, defined in the real world (my room).
(This post was last modified: 02-21-2014, 01:25 PM by jorgeas80.)
02-21-2014, 01:25 PM
Website Find Reply
Romulator Offline
Not Tech Support ;-)

Posts: 3,623
Threads: 62
Joined: Jan 2013
Reputation: 195
#4
RE: Position relative to what?

Well, I know you're working with Penumbra, but I turned to AAMFP assets to look at sizes.

The 4x8m road which can be found in the streets for static_objects is what I used in this example.

I took the long side of the road and put it down at 0,0,0, without rescaling or rotating. At 0.25 snap, there are 32 squares along the Z-Axis. At 0.5, there are 16, and at 1.0, there is 8. Therefore having a 1.0 set as the snap sep. is equivalent to 1m.

Not ENTIRELY sure if it is the same for Penumbra, because I cannot develop with those if I don't have the game (Tongue) but those were my findings with that Smile

Edit: And no, not arbitrary. It is primarily the centre point of the whole map, the area which can be seen first in the perspective view, where the 3 Axis cross over (again, do not know if this is in Penumbra's dev tools).

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 02-21-2014, 01:54 PM by Romulator.)
02-21-2014, 01:52 PM
Find Reply
jorgeas80 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jan 2014
Reputation: 0
#5
RE: Position relative to what?

(02-21-2014, 01:52 PM)Romulator Wrote: Well, I know you're working with Penumbra, but I turned to AAMFP assets to look at sizes.

The 4x8m road which can be found in the streets for static_objects is what I used in this example.

I took the long side of the road and put it down at 0,0,0, without rescaling or rotating. At 0.25 snap, there are 32 squares along the Z-Axis. At 0.5, there are 16, and at 1.0, there is 8. Therefore having a 1.0 set as the snap sep. is equivalent to 1m.

Not ENTIRELY sure if it is the same for Penumbra, because I cannot develop with those if I don't have the game (Tongue) but those were my findings with that Smile

Edit: And no, not arbitrary. It is primarily the centre point of the whole map, the area which can be seen first in the perspective view, where the 3 Axis cross over (again, do not know if this is in Penumbra's dev tools).

Interesting finding. Thanks!

When you say "I took the long side of the road...", which tool have you used to get those numbers? I have Blender installed, not Maya or 3DMax.

Currently, I'm diving into the code, looking for the place where the world coordinates are set. If I know where is the (0, 0, 0) point in the World3D object (this is an actual object in the code), I can define this point in my space, and translate the position of the objects from one system (the game) to the other one (my own space)
02-21-2014, 02:06 PM
Website Find Reply
Romulator Offline
Not Tech Support ;-)

Posts: 3,623
Threads: 62
Joined: Jan 2013
Reputation: 195
#6
RE: Position relative to what?

Ahh! Well, I was using Amnesia: The Dark Descent's Level Editor to get relative sizes Blush

I haven't ever used Blender or anything similar to look at sizes, because I just place things on a map, not really into the model editting aspect :3

With that said, I would expect that xyz = 0 would be the exact centrepoint of the default cube which loads when you start a new project, at least globally. Locally however, it would probably be the centrepoint of any object.

Edit: This is what I mean: Setting the snap to 1.0, and putting it down on 0,0,0 on Amnesia's Level Editor gives you a 1m^2 of road (at least long ways Tongue) Though it doesn't help much Blender wise, it does give a perspective of relative size in Amnesia. If you can import such model, you can get an idea of sizes Smile Following the same formula, Amnesia's default walls are 4m long and 4m high. [Image: ff05tj.png]

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 02-21-2014, 02:27 PM by Romulator.)
02-21-2014, 02:17 PM
Find Reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#7
RE: Position relative to what?

I think that in a modelling program, every space is defined by an absolute point that exactly in the middle of the space. The coordinates are EXACTLY, 0 0 0. They just added several points that deviate from that central coordinate in regular movements (1 block may be 0.25/0.125 meters apart).

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-21-2014, 02:33 PM
Find Reply




Users browsing this thread: 1 Guest(s)