-
Posts
230 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Charrua
-
-
Now I activated the color camera and getting the color information, copying it to a texture and drawing on the screen (up left) so there I'm!
Using multiple buffers and a shader to draw clipped parts of them on the screen, increased fps from 15 to 30 even with getting color kinect camera and copying it (by hand: pixel by pixel) to a leadwerks texture .
video:
Also I'm tracking Head, Shoulders, center of shoulders and center of body. A circle is drawn (more or less in the correct place) on each of the tracked joints if kinect report it as detected.
The program moves the "player" camera which is at the central "window" of the screen and the intention is to show in a window what a player actually has to see if he were watching the 3d world through that window.
Movement is followed correctly except at the last part of the video in which i place my hands in front of my face... so gets hard for the kinect to track me. As you can see, circles appear and disappear and when this happens, the camera control isn't correct.
Juan
- 2
-
thank's
aside of another problems i have... now is working if and only if the boxes that has the textures are not hidden
if i hide a box, then it's texture isn't updated
based on the "intended behavior" (not so logical to me) sounds ok, because if the system do not update a texture of an object outside the view of the camera, then it will not render a texture of a hidden box.
the documentation refers that the texture "can" be used in a material and applied to an object, or draw on screen" i understand from that that "can" is not "must" (but my English is terrible).
any way, our language (english spanish etc) isn't so exact as computer languages so my problem is not with documentation, knowing what is possible to do and what isn't is what i need.
i was working with buffers, doing a world::render for each one and then getting the texture from the buffer, doing some handling on the texture (cropping it mostly) and then drawing each processed texture.
Started doing cropping by hand (memcpy) and reaching a 14 fps on my laptop
then as pointed by macklebee (thank's man) i starting to try a shader to do so
after some mistakes of mine (use to have lots) i make it work and fps rise up to 28
so, i starting to ask, what about render to a texture instead of render to a buffer...
well if i render to textures i'm having 12 fps (worse than using by hand texture copy, crop: handling) and i have to have in front of the camera boxes with those textures on it (not supposed to be)
probably i'm still doing something wrong, but for now i'll keep with buffers + shader
thank's for your help
Juan
-
I was trying to render to a texture without success.
Texture shows always the same no matter the camera position/rotation...
I roll back to the RenderToTexture Lua example, wrote it for cpp and works ok, then i realize that:
1) If the texture is not applied to a material then the rendered texture is what the camera sees when at it's starting position/rotation : 0,0,0 / 0,0,0
2) if the texture is applied to a material, and this material is applied to an object, the rendered texture is ok if the object is visible by the camera, if not, then the rendered texture is again what the camera sees on the default position.
The documentation says:
" The texture can be used in a material and applied to an object, or drawn onscreen. "
but if not applied to a material, it does not render, and if applied to a material then it mus be applied to an object visible by the camera.
following is a cpp to test, with the commented lines (with //) the example do not work
if applied to the box works ok until you uncomment the line that moves it outside the view range of the camera.
perhaps this is the intended behavior and i am missing something obvious.
What I need is to render to a texture with the intention of draw it with context->DrawImage. I do no plan to place a visible object with the texture in front of the camera.
is it possible to render to a texture without applying it to an object with a materila with it?
thank's in advance
Juan
#include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } Model* model = NULL; Camera* camera2; Pivot* pivot; Material* mtl; Texture* tex; bool App::Start() { window = Window::Create("render to textue",0,0,1024,768); context = Context::Create(window); world = World::Create(); camera = Camera::Create(); camera->Move(0, 0, -3); Map::Load("Maps/start.map"); Light* light = DirectionalLight::Create(); light->SetRotation(35, 35, 0); camera2 = Camera::Create(); camera2->Move(0, 0, -4); camera2->SetClearColor(1, 0, 0); pivot = Pivot::Create(); camera2->SetParent(pivot); pivot->SetPosition(-2, 2, 1); tex = Texture::Create(256, 512); mtl = Material::Create(); mtl->SetShader("Shaders/Model/Diffuse.shader"); mtl->SetTexture(tex); camera2->SetRenderTarget(tex); model = Model::Box(); //model->SetPosition(0, -4, 0); //if not visible: render texture gets freezed //model->SetMaterial(mtl); //if material is not applied to a visible object render texture gets freezed model = Model::Cylinder(); model->SetColor(0.0, 1.0, 0.0); model->SetPosition(0, 0, 0); model = Model::Cone(); model->SetColor(0.0, 0.0, 1.0); model->SetPosition(2, 0, 0); return true; } bool App::Loop() { if (window->Closed() || window->KeyDown(Key::Escape)) return false; pivot->Turn(0, Time::GetSpeed(), 0); Time::Update(); world->Update(); world->Render(); context->DrawImage(tex, 10, 10); context->Sync(); return true; }
-
Hi, i'm working on a shooting simulator. Here are some screenshots. The graphics part of it isn't of too much interest at this stage I'm more concerned about the hardware interface with the guns.
Gun range:
6 feet under (more or less)
Out side
Testing the app with the mouse (not the intended input, but for ease)
https://drive.google.com/open?id=0B8-7vR0QcsPkaDBXRk5qUzc1Tkk
https://drive.google.com/open?id=0B8-7vR0QcsPkbG5hWFFPZHV6b3c
https://drive.google.com/open?id=0B8-7vR0QcsPkZlJxU0M1emhxeUE
Testing it with the real input hardware.
https://drive.google.com/open?id=0B8-7vR0QcsPkMlJLVENIRWRCZ0k
https://drive.google.com/open?id=0B8-7vR0QcsPkbmZGeGFPUHE1OW8
https://drive.google.com/open?id=0B8-7vR0QcsPkNXJ1QVNiNHl1c3M
https://drive.google.com/open?id=0B8-7vR0QcsPkMDRLaThmZDcwbDQ
https://drive.google.com/open?id=0B8-7vR0QcsPkcV8wbV94WkhpRDg
https://drive.google.com/open?id=0B8-7vR0QcsPkUlNVbTl1Y3dqYVU
Juan
- 1
-
nice
has you found a way of getting constant speed over the spline?
are you using some criteria for placing control points based on endpoints?
i mean, you only set the endpoints and then pre-calculate based on them the control points, then manually adjust the ones that need adjustment...hope you understand my question.
-
thank's
i'm using the 360 SDK v1.8
the video was made with aproject that only loads a map and connects to the kinect, the other hawdware/software was not present.
the complete systems includes guns with a sensor on the trigger and a IR laser beam, and an IR camera to know where the gun's are heading...
gun:
https://photos.google.com/photo/AF1QipOqR9tke1JGI1CstXfA8BTUuf10rsGBG0BC0Tg
stuff
https://photos.google.com/photo/AF1QipMEaQRfJe9fK8v7AlRiUxERY5iUYLOiS2fVNec
test (no kinect still, no scene at all either!)
https://photos.google.com/photo/AF1QipPydG6AouTsLWBA1gi2UcZio6ym1MF2tl364wU
-
Hi, i'm doing some test with a kinect, the idea is to follow player's position (head tracking) and project on a screen (not laptop or pc screen/monitor) 5 meters away from the player a "window" through which we see the 3D world. Each player has it's own line of sight and a "window" to look throug.
First test are nice
(ok, are not the first tests.. this is the first that look promising!)
Juan
- 2
-
quite interesting! thank's i'll give it a try.. for a while
-
is there a simple way of copying a sub part of an image/texture to other image/texture.
i mean, instead of getting the pixel data and copying pixel by pixel with a couple of nested for/next loops?
has leadwers a copyrect o drawrect command?
Juan
-
The ctrl-arrow thing drives me nuts! That's my primary means of navigation and it gets me every single day
totally agree, i'm just fan of crtl left/right, auto indentation and many other helper thing's we usually has on editors
(i came from the Ctrl+K+AnotherNiceKey era!, when a mouse simply were a strange thing)
-
don't know it it's a bug, but this afternoon happens to me that i minimized the leadwerks editor, left the laptop alone for a while and it goes to sleep. After wake up, i couldn't maximize the editor. I close and start again and i goes minimized.
i take a look at the .cfg file and found the "MainWindowShape" parameter with this:
MainWindowShape="-25600","-25600","136","47","0"
i look on other .cfg files posted here and simply replace this line for something like
MainWindowShape="236","27","1186","768","0"
and start leadwerks again and looking as spected.
i simply report this issue, and a solution i found.
Juan
-
great!
thank's for sharing
just a small note (happens to me :
in:
function Script:Record_Mode_Toggle()
FileSystem:WriteFile retutn null if lua sandboxing is enabled
a check for a null and an advice would be nice
Juan
- 1
-
the "someValue" should be dependent of the distance from the player and the camera, probably the angle (camera x angle) and naturally the camera FOV
-
if you want the bar over the head in 2d space
project the head, and then use the 2D x axis as the center of the bar, and use the 2D Y axis minus some value to rise up (in 2D space) the bar. isn't it?
-
hi, here there are some notes i wrote about c++ lua bindings
http://www.leadwerks.com/werkspace/blog/183/entry-1612-lua-cpp-bindings-how-to-tutorial-17/
once yo compile your c++ code, that one is used from the Leadwearks editor when you press paly/debug on the editor.
-
Hi, My name is Juan Ignacio Odriozola, from Uruguay, a little country between Brasil and Argentina, south America.
With just 52 years old i'm a teacher and technician in electronics. I work for the phone company in Operation & Maintenance and as a Teacher in a couple of institutes (ORT university and a Militar Institute on courses about microcontrollers mainly)
I always love to interface the PC with other hardware beyond a keyboard, mouse and screen, so my projects all include some microcontrollers and use some high level programming language to show what's happen.
Some years ago, for one of my projects entered he 3D world, not for a game, but simply i couldn't leave it.
I started with Blitz3D and test other engines in between and ended here. Leadwerks has good support and community
Now i'm working on a shooting range, ok souds like a shoot them all game, but the idea is not shoot any thing that moves, is for fire practice and learn so, gun handling is evaluated as where the participant is hitting. I'm talking about real guns with sensors. Not keyboard, mouse and joystick.
It's under development in the firs stages and hope to has something nice to show... some time in the future.
Nice to meet you all
Juan Ignacio Odriozola
- 1
-
i tested the opposite, change a key in cpp and test it on lua side.. i realize how i forgot how to code in lua..
--simply to pass data to c++ Script.AnInt=0 --int "anInt" Script.AString="Hola" --string "string" function Script:Start() self.entity:SetKeyValue("anInt", self.AnInt) self.entity:SetKeyValue("aString", self.AString) end function Script:UpdateWorld() if self.entity:GetKeyValue("anInt") ~= self.AnInt then self.AnInt = self.entity:GetKeyValue("anInt") System:Print("AnInt changed: "..self.AnInt) end end
and in cpp, after found "theEnt" (as i named the entity with this script attached) and storend on a Entity* pointer..
i delared a glogal int
int anInt=0;
in main loop:
somewhere:
if (window->KeyHit(Key::G)) { anInt++; theEnt->SetKeyValue("anInt", String(anInt)); }
-
found a script i used ... when testing set/get key value
its called EntData.lua
--simply to pass data to c++ Script.AnInt=5--int "anInt" Script.AString="Hola"--string "string" function Script:Start() self.entity:SetKeyValue("anInt", self.AnInt) self.entity:SetKeyValue("aString", self.AString) end
if you attach this script to an entity in the editor, you may set the values you want and at startup, keys are asigned to the entity
i'm sure i used that to then read the keys from cpp side, i only found the lua side
other thing i used to use... just because name is safe, was use the "name" as a csv, with something like
name=theentty, customval1=34, customval2=hola, and so..
then whit a utiliti function like getNthCsvFromString(string s, int nth)
i get the "name" key and get the individual csv items with the previous function... i know that this kind of names are a mess, but
was what i used before knowing better ones
jio
- 1
-
this is from when?
last year i passed via keyvalues data from cpp to lua and back to cpp
using an entity as a placeholder.
this is not working at present?, i don't tested recently
-
but if you find the "block" entity, then GetKeyValue("name") is working.
"name" is a key already implemented, so it allways work, you have a textbox on the editor for the name.
if i'm not wrong, then the problem is with keys created by you, isn't it?
probably your problem is on the SetKeyValue command, which i suppose you are setting in the lua script.
-
where is world created?
if in lua, then cpp world should be empty (or NULL)
-
these both are very handy, or if you named the object properly then you can search it inside the world->Entities list
see:
http://www.leadwerks.com/werkspace/blog/183/entry-1613-lua-cpp-how-to-27/
-
thxs
agrror is back again!, i thought he stopped flowgui dev, seems that an update is coming
jio
- 1
-
Hi
As the subject says.
Last forum thread about cegui is about 5 years,
I spent last weekend without success.
i like to know if currently someone get it working with leadwerks and if it worth the effort.
I need a gui for leadwerks, so any advice about some other gui would be appreciated
I was testing awesomium but it´s just an interface for a html generated web page/form/dialog and so you have to start codign html, javascript... jquery, jquery UI...
i do like a gui that has a layout editor and/or create windows, controls etc, by code.
thank's in advance
jio
Playing with Leadwerks and a Kinect
in Showcase
Posted
ok, now i started to look for alternatives.
a web camera and face recognition with opencv