MisterGravity Posted January 12, 2014 Share Posted January 12, 2014 I know there's a camera object, so it is possible to point the camera somewhere, then have a side of a brush be the output of what that camera sees? Think "security cameras". Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2014 Share Posted January 12, 2014 http://www.leadwerks.com/werkspace/topic/8103-gameplay-tutorial-requests-here/ Last link on the first page. Bookmark that topic because we'll be adding lots to it and I will update the first page to make it easier to fine 1 Quote Link to comment Share on other sites More sharing options...
MisterGravity Posted January 12, 2014 Author Share Posted January 12, 2014 http://www.leadwerks.com/werkspace/topic/8103-gameplay-tutorial-requests-here/ Last link on the first page. Bookmark that topic because we'll be adding lots to it and I will update the first page to make it easier to fine Thanks Rick! You come through again! Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2014 Share Posted January 12, 2014 To be fair Shadmar made that script Quote Link to comment Share on other sites More sharing options...
MisterGravity Posted January 12, 2014 Author Share Posted January 12, 2014 To be fair Shadmar made that script Do you think Shadmar or anyone has an example project I could download on this? The script is a little vague on the first three variables. Well wait a minute now, I've been playing with it and I what I've done is point a camera straight down over an area, and then display that on a screen. Unfortunately, I can't see my first person camera anymore. I just see my hands carrying a gun around from a top down view, which is a little weird. How can I still see what I need to see first person, but the camera view be the one I've setup? Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2014 Share Posted January 12, 2014 For the tracking pivot variable, just place a pivot in your scene. The pivot has a position and direction (you can rotate it). The position & direction the pivot is pointing, will be where the camera gets placed so it's what the camera will see. You'll probably have to play around and trial and error get get the perfect direction it's pointing at. The main camera is the camera. Place a camera in your scene and drag it to this parameter RenderToMaterial can be any material. I believe whatever is used in the material as the texture gets overwritten anyway. Quote Link to comment Share on other sites More sharing options...
MisterGravity Posted January 12, 2014 Author Share Posted January 12, 2014 For the tracking pivot variable, just place a pivot in your scene. The pivot has a position and direction (you can rotate it). The position & direction the pivot is pointing, will be where the camera gets placed so it's what the camera will see. You'll probably have to play around and trial and error get get the perfect direction it's pointing at. The main camera is the camera. Place a camera in your scene and drag it to this parameter RenderToMaterial can be any material. I believe whatever is used in the material as the texture gets overwritten anyway. I got that far, but the thing is, when I bring a new Misc / Camera into the scene, it becomes what I see all the time when I run the game. I lost my first-person-camera eyes when I walk around. How do I get that back, but keep the rest of it working? (The camera I placed IS displaying what it sees on the screen I setup, I just lost my own first person viewpoint.) Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2014 Share Posted January 12, 2014 You only want 1 camera ever in your scene (for the most part). This script will take your camera, move it to the pivot, take a "snapshot", then restore where it was all before you know it even did it. Quote Link to comment Share on other sites More sharing options...
MisterGravity Posted January 12, 2014 Author Share Posted January 12, 2014 You only want 1 camera ever in your scene (for the most part). This script will take your camera, move it to the pivot, take a "snapshot", then restore where it was all before you know it even did it. Okay, I'm soooo almost there. I replaced the camera I placed in the scene with a 2nd pivot, and when I run it, I see what "I see", as in my first person camera on the screen. How can I point the camera/pivot if it doesn't have a cone like lights and cameras do? Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2014 Share Posted January 12, 2014 Trial and error with the rotation Also, are you using the same material you passed to the script on some csg or something? That will be what the "security camera" sees. Quote Link to comment Share on other sites More sharing options...
MisterGravity Posted January 13, 2014 Author Share Posted January 13, 2014 Trial and error with the rotation Also, are you using the same material you passed to the script on some csg or something? That will be what the "security camera" sees. You say trial and error, but I'm not even seeing directions to point to. It's just a pivot, like a waypoint with no cone that you would send Moving Platforms to. See, take a look: Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 13, 2014 Share Posted January 13, 2014 Here's the deal. If you are using the base FPSPlayer script this won't work because that creates a camera in itself. (This is why I don't like that script). You don't need a pivot to replace the camera. What you need to do if look at my teleport tutorial and pay attention to the beginning where I change teh FPSPlayer script to accept a camera as a parameter instead of making one in itself. This allows you to drag a camera entity in your scene as the main camera that you can drag into the FPSPlayer script (after you make the change in my tutorial) AND drag it to this script as well. The FPSPlayer script is great for a quick drop and drag and it just works, but with it making it's own camera, it sort of screws up other scripts that need to use a Camera. This is why I changed the script in my tutorial. Quote Link to comment Share on other sites More sharing options...
Admin Posted January 13, 2014 Share Posted January 13, 2014 This is a really good idea for a new example map for us to add. It might be necessary to add an extra commands to make it easier, like set a texture for a camera to automatically always render to. It's certainly possible right now through the API we have, but if we had an official example I could use that to figure out how to make it *really* easy to set up. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 13, 2014 Share Posted January 13, 2014 We got it figured out. The concept of the pivot being a placeholder to where the camera will move to and take a picture and then move back to the player can be confusing to people new to Leadwerks/game development. Quote Link to comment Share on other sites More sharing options...
Admin Posted January 13, 2014 Share Posted January 13, 2014 I'd be interested in seeing your implementation. Quote Link to comment Share on other sites More sharing options...
MisterGravity Posted January 13, 2014 Author Share Posted January 13, 2014 I'd be interested in seeing your implementation. I'll make a video and or write out exactly what we did. Rick is a brilliant, brilliant guy. Josh, now might be a good time to BEG you for a "point to" feature. As in, this light should point to that spot. Or that pivot should point to that spot. A simple static point to would be fantastic. A dynamic following pointer would be the bee's knees. All this guess work on in a three-dimensional plane is exasperating. You know, now that I think about it, is there a way to get the x,y,z coordinates of a location, like where your mouse pointer is, and then put that in a "point to x,y,z" of a light or pivot? Is there already an easier way than the rotate buttons, test, try again, test, try again...etc.? Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 13, 2014 Share Posted January 13, 2014 Here you go. Start.map. You'll see the backside of the middle csg (orange) on the monitor. Quote Link to comment Share on other sites More sharing options...
flachdrache Posted January 13, 2014 Share Posted January 13, 2014 Le2 framework has its listener bound to the main camera which made it difficult iirc - you don't get any sound issues with positional audio ? Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
shadmar Posted January 13, 2014 Share Posted January 13, 2014 The script relys on a camera you can link in. FPSplayer, creates a camera which should be disabled and linked in via Script.Camara instead. The pivot is like you said the position/rortation (matrix) where maincamera will be moved and snapshot into the buffer and back again. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted January 13, 2014 Share Posted January 13, 2014 --Fetch CCTV material mat=Material:Load(self.RenderToMaterial) self.entity:SetMaterial(mat) should really be in Start() not in Loop() Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
flachdrache Posted January 13, 2014 Share Posted January 13, 2014 Well, that might was poorly worded - rick suggests pure object orientation with the camera being an object, the "only" other option would be self aware/containing objects ( with a own camera using disable old/ enable new ). Now, in le2 framework I "must" use the later because the ears ( listener ) are at the main cameras position "always" - fobaring positional audio e.g. light humming etc ... that's was what I wanted to point out - if you want to have it extensible ... or as a base etc. for beginner : sorry'bout all the "" ... le2 programmer know ( or should remember ) all the little issues we had ... and still have tbh. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
MisterGravity Posted January 14, 2014 Author Share Posted January 14, 2014 There is actually one last issue I'm having with this that I can't seem to overcome. If my player has a Weapon equipped, like "autopistol.pfb", then the security screen display also shows my hand holding that pistol. Is it possible to draw the camera without it also seeing that? Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
shadmar Posted January 14, 2014 Share Posted January 14, 2014 Yes, in the script link in your gun/hand and add before and after render() .., something like this : gun:Hide() App.world:Render() -- render to buffer your pivots matrix gun:Show() Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
MisterGravity Posted January 14, 2014 Author Share Posted January 14, 2014 Yes, in the script link in your gun/hand and add before and after render() .., something like this : gun:Hide() App.world:Render() -- render to buffer your pivots matrix gun:Show() Yep, I bet that is going to do it. Before you give me any answers on how to link in my gun/hand, let me try to figure that out on my own. I'm getting better at Lua by the minute. Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
MisterGravity Posted January 16, 2014 Author Share Posted January 16, 2014 This script is capable of having multiple security cameras, right? I've created 2 different securityCameraTextures, put them on two different surfaces, created two different pivots and pointed them were I want them to be, and I'm still amazingly seeing the same screen on both of them which should absolutely not be possible since the textures they're going to are completely different from each other. Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.