![]() |
|
3D Cam, Positioning Problem - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: 3D Cam, Positioning Problem (/thread-1431.html) Pages:
1
2
|
3D Cam, Positioning Problem - TheOneAndOnlyTee - 28-10-2015 I've been trying to position CL models just above the hud but i'm never able to place them like i would holograms and when i get close it moves around when i look around. I have seen it done before but i never asked how he/she managed to do it. RE: 3D Cam, Positioning Problem - Person8880 - 28-10-2015 Think of 3D cameras like a completely separate world. Everything rendered inside them is rendered in their space, not the game world's space. You provide the position and angles for the camera in the 3D camera context's world, so you need to position your client-side model to be in view. I think the most common idiom that makes it easiest, is to use your eye position and aim angles for the context's camera, and then position the client-side model relative to your player's game world position. That will give you something that mimics the game world. RE: 3D Cam, Positioning Problem - Destiny's Player - 28-10-2015 Here's the way I did something akin to that with an emitter. Needs some tweaking and might be a crutch, but it works.
RE: 3D Cam, Positioning Problem - TheOneAndOnlyTee - 28-10-2015 Uh thats 3D2D Destiny not 3D, the difference being the that 3D renders models/3D objects Thanks Person i'll test that and let you know how it goes RE: 3D Cam, Positioning Problem - TheOneAndOnlyTee - 29-10-2015 Tested this code
but the result was this RE: 3D Cam, Positioning Problem - Destiny's Player - 29-10-2015 (28-10-2015, 11:49 PM)T-17 Wrote: Uh thats 3D2D Destiny not 3D, the difference being the that 3D renders models/3D objects Practically, there's no difference. Just use the formulas that I have in there, and tweak them to how you need them. They simply position the screen in front of the player's face and keep it there, no matter the direction. it's simple enough to do the same with a model just by tweaking the numbers. And also adding a formula for the vertical angle, should be almost the same. RE: 3D Cam, Positioning Problem - TheOneAndOnlyTee - 29-10-2015 actually it's a little different because the 3D2D renders inside the game space and 3D doesn't as Person mentioned above, merely positioning it in world space does work but the angles seem screw up the CL model positioning. RE: 3D Cam, Positioning Problem - Destiny's Player - 29-10-2015 Hmm... That's curious. Anyway, these formulas might still help you somewhat, at least in calculating the position in the world where all of that should be. RE: 3D Cam, Positioning Problem - Person8880 - 29-10-2015 The way you've positioned it, it will always render in the 3D camera's world at the equivalent position of being 55 units above your chip. Given your 3D camera is using your player camera parameters, you've essentially positioned that sphere in the world at that point, almost exactly like a hologram. If you want this sphere to be always visible, you have to position it relative to your eyes rather than the chip, so that it's always in view. RE: 3D Cam, Positioning Problem - TheOneAndOnlyTee - 29-10-2015 whenever i look around the sphere is offset by the angle, i intended it to be placed like a hologram ie fixed to the position defined but it seems that the 3D rotates as i do and then the virtual ent pos is moved but it shouldn't have been moved |