Jump to content

Gilmer

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by Gilmer

  1. If i simply give ok and download the files, it downloads the version already 2.23? Or cotinues downloading the 2.1? Because after downloading, the file "version.txt" continues informing that the version 2.1 is the most current. And i not find this option "2.32Beta".
  2. Here is the problem .. So, I try to reformulate my question, I do not speak English very well, I guess I'm not getting play me right ... hehehe I have two cameras on the scene, one is the framewerk, which normally created in the editor, and the other is one I created the script .lua of model. But the problem is that when i send rendering some image created by the camera, it renders everything except the skybox. The visions they are having: What function should i use to be able to show the skybox on the second camera? thanks joh
  3. how i can download the update??
  4. no one? I need to know how I do to render the skybox from the background of framewerk, through a file .lua of some model. I already tried a lot of ways but I can not, the documentation is not very explanatory: fw.main.world.GetBackground().. fw.background.... how??
  5. ok, but how can I access the background of framewerk? And one question, how do i change a texture, which is inside the file.mat? For example, in the file, is this: "texture0=reflect.dds" How i can create a texture, but the shader always update the new texture?? Thanks Joh...
  6. Well, my objective is to create a texture that update dynamically. A cubemap dynamic, for example. Each face of this texture, will have 256x256. I did the following, I took a shader, which mounts the cube map, from a 1536x256 texture. Being a face side by side, so I need updating this texture. I want to do so, put the camera in the center of the object, render, and place the rendered texture (256x256), in the buffer that I created that has 1536x256. So rotate 90 degrees to the camera, rendering, and position in the buffer on the side of the texture you created earlier. So it goes ... But the problem is the rendered image is not rendering the skybox. Only the models around. Is there any command that I need to upgrade to, or set it? Here's a picture of my scene. The camera to render this is inside the box: And the code used in the box model: require("scripts/class") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") local class=CreateClass(...) fw=GetGlobalObject("framewerk") function class:CreateObject(model) local object=self.super:CreateObject(model) cameracube = CreateCamera() CameraClearMode(cameracube,1+2) CameraClearColor(cameracube,Vec4(255,0,0,0)) cameracube:SetPosition(model:GetPosition()) cameracube:Hide() rotcam = cameracube:GetRotation() --main camera maincamera = fw.main.camera -- buffers mainbuffer = CurrentBuffer() buffercam = CreateBuffer(GraphicsWidth(),GraphicsHeight(),1+2+4) --bufferlight = CreateBuffer(GraphicsWidth(),GraphicsHeight(),1+2+4) buffertex = CreateBuffer(256*2,256,1+2+4) --buffertex2 = CreateBuffer(256,256,1+2+4) function object:Update() model:Hide() cameracube:Show() maincamera:Hide() --Visao1 cameracube:SetRotation(rotcam) SetBuffer(buffercam) RenderWorld() RenderLights(buffercam) colorbuffer = GetColorBuffer(buffercam) SetBuffer(buffertex) DrawImage(colorbuffer,0,256,256,-256) --Visao2 cameracube:Turnf(0,90,0) SetBuffer(buffercam) RenderWorld() RenderLights(buffercam) colorbuffer = GetColorBuffer(buffercam) SetBuffer(buffertex) DrawImage(colorbuffer,256,256,256,-256) SetBuffer(mainbuffer) colorbuffer3 = GetColorBuffer(buffertex) colorbuffer4 = GetColorBuffer(buffertex2) cameracube:Hide() maincamera:Show() DrawImage(colorbuffer3,0,256,256*2,-256) --DrawImage(colorbuffer4,0,512,256,-256) Flip() model:Show() end end And as I do for the texture image rendered, not flashing on the screen there? Thanks all (I posted here, why do not know what would be the most appropriate place for this doubt)
  7. Gilmer

    cubemap

    But have a problem, in this example is not dynamic, how i can make this dynamic? thanks lumooja...
  8. Hello all.. There is some way, that i'm changing the dimension of buffer? For example, i want get the buffer renderized, and send to a texture. But the buffer, have a resolution of the 800x600, and the texture, 256x256. How i can resize, and assign to the texture?? Thanks
  9. Gilmer

    cubemap

    I wonder if someone ever used some shader of cubemap? If yet, how did it? I wonder to put in some models, dinamics reflects, have a long time im trying this, but until now, i not have sucessful with this... someone have any ideas? or suggestion?? thanks
  10. Thanks Josh, for your help.. The question of the transparency, i could solved, by the tutorial... The question of the cubemap, i have not tried it yet. Anything i post here... now the car, the source i using this: require("scripts/class") require("scripts/loop") require("scripts/math/math") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) function object:UpdateMatrix() self:UpdateTires() end function object:UpdateTires() local speed for n=0,3 do if self.tire[n]~=nil then self.tire[n]:SetMatrix( self.vehicle:GetTireMatrix(n) ) if self.emitter[n]~=nil then self.emitter[n]:SetMatrix(self.vehicle:GetTireMatrix(n)) self.emitter[n]:Pause() if self.vehicle:TireIsAirborne(n)==0 then speed = math.abs(self.model:GetVelocity(0).z) speed = (speed - 4) / 20.0 speed = Clamp( speed, 0, 1 ) * 0.1 if speed>0 then self.emitter[n]:Resume() self.emitter[n]:SetColorf(1,1,1,speed) end end end end end end local pivot local suspensionlength=0.2 --0.2 -- Altura da suspensao local springconstant=10.0 --50.0 -- Rigidez da suspensao local springdamper=500.0 --300.0 -- Força da mola object.vehicle=CreateVehicle(object.model) object.tire={} object.emitter={} pivot=object.model:FindChild("tire2") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[0]=LoadMesh("abstract::tire_left.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("tire1") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[2]=LoadMesh("abstract::tire_left.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("tire4") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[1]=LoadMesh("abstract::tire_right.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("tire3") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[3]=LoadMesh("abstract::tire_right.gmf",object.model) pivot:Hide() end object.emitter={} object:UpdateTires() if world_transparency~=nil then if world_main~=nil then SetWorld(world_transparency) for n=0,3 do if object.tire[n]~=nil then object.emitter[n]=CreateEmitter(50,2000,Vec3(0,1,0),0,object.tire[n]) object.emitter[n]:SetPosition(Vec3(0,-object.tire[n].aabb.h/2.0,0)) object.emitter[n]:SetParent(model,1) object.emitter[n]:SetRadius(1,6) object.emitter[n]:SetWaver(1.0) object.emitter[n]:Paint(LoadMaterial("abstract::roaddust.mat")) object.emitter[n]:SetRotationSpeed(0.1) object.emitter[n]:Pause() end end SetWorld(world_main) end end object.model.buoyant=0 object.model:SetKey("collisiontype",COLLISION_PROP) object.model:SetKey("mass",5.0) --object.model:SetKey("friction","1,0") object:UpdateTires() end And this, the main to start game: require("Scripts/constants/keycodes") require("Scripts/linkedlist") require("Scripts/filesystem") require("scripts/math/math") require("scripts/constants/engine_const") FlushKeys() HideMouse() local camera = fw.main.camera chassis=LoadModel("abstract::pista1_models_carro_carro1.gmf") carobject=objecttable[chassis] car=carobject.vehicle --chassis:Turnf(0,180,0) car:Hide() if car==nil then Notify("Vehicle object not found.",1) chassis:Free() return end chassis:SetPosition(TFormPoint(Vec3(0,-1,10),fw.main.camera,nil)) chassis:SetRotationf(0,camera.rotation.y+180.0,0) --Variables local dx=0.0 local dy=0.0 local camerapitch=camera.rotation.x local camerayaw=camera.rotation.y local move=0.0 local strafe=0.0 local steering = 0.0 local torque = 0.0 local steerlimit = 30.0 local steerrate = 2.0 local steerangle=0.0 MoveMouse(Round(GraphicsWidth()/2),Round(GraphicsHeight()/2)) while KeyHit(KEY_ESCAPE)==0 do --Camera look gx=Round(GraphicsWidth()/2) gy=Round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,90) camerapitch=math.max(camerapitch,-90) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) local tirespeed=-(KeyDown(KEY_W)-KeyDown(KEY_S))*70.0 car:AddTireTorque(tirespeed,0) car:AddTireTorque(tirespeed,1) car:AddTireTorque(tirespeed,2) car:AddTireTorque(tirespeed,3) steermode=0 if KeyDown(KEY_A)==1 then steermode=steermode+1 end if KeyDown(KEY_D)==1 then steermode=steermode-1 end if steermode==1 then steerangle=steerangle+4.0*AppSpeed() elseif steermode==-1 then steerangle=steerangle-4.0*AppSpeed() else if steerangle>1 then steerangle=steerangle-4.0*AppSpeed() if steerangle<0.0 then steerangle=0.0 end else steerangle=steerangle+4.0*AppSpeed() if steerangle>0.0 then steerangle=0.0 end end end steerangle=Clamp(steerangle,-25,25) car:SetSteerAngle(steerangle,0) car:SetSteerAngle(steerangle,1) fw:Update() local campos=TFormPoint(Vec3(0,1,0),chassis,nil) fw.main.camera:SetPosition(campos) fw.main.camera:Move(Vec3(0,0,-10)) local t=TFormVector(Vec3(0,0,1),camera,chassis) a=-math.deg(math.atan2(t.x,t.z))+180.0 chassis:Hide() local pick = LinePick(campos,camera.position,0.5,COLLISION_PROP) chassis:Show() if pick~=nil then camera:SetPosition(pick.position) end fw:Render() Flip(0) end chassis:Free() chassis=nil camera=nil ShowMouse() I sending to your email (support@leadwerks) the files of the car. I sending like "udco@unidev.com.br", ok?! Thanks for support and help josh... (:
  11. I think this imagem show exactly what i want make. I want the reflect of scene, show in the car, and when it is moving, update the texture: And two more question that arose: 1. In this model, i make the glasses, with intention to put a transparency in it, but dont with 100% transparency, and only half, to appear the interior side. I made the pilots, and the benchs, but they not appears. What material configuration i need set to made a half transparency?? I put in the alpha channel texture dds of the diffuse, a gray color, but in this, it have some bugs, and render the models aways from the car. 2. To physics car, i copy the sample file of the ViperScout. Only change some parameters of suspension and rigidity, but the problem is that sometimes the car model make a slipped in the road, like is slippery. Is some configuration to the tires?? I try change the both parameters to the friction, but dont solved the problem with this... thanks
  12. Then, in reality, what I want, is as follows: Create a reflex to a model, with a metallic material. But i want this reflex update, showing all objects already of reflex. I think this, would a "dynamic cubemap", right?! That example "Reflect_water.cpp", is a example of dynamic cubemap? I try pass it to Lua, but the problem is the cameras. How i can access the main camera of game, if the file .lua is only a "complement" of model, whith the command of framewerk for this? thanks
  13. Hi, Necessary to make dynamic thanks
  14. Hello, I'm having a doubt it and that I can not solve. How can I create cubemap for reflexes? I made a model of a car recently, and I would add it on the map specular reflections. But it has one but, as I do it through the .lua? I saw an example of the water in C + + that comes with the engine, but I wonder how I can configure it for .lua, which already has a few lines to hide the camera, creating another camera... thanks
  15. cool .. it was this same problem. I used the converter that comes with the engine of obj2phy. There must be something wrong with the exporter from max. But ok. Now this working ... hehe Thank Aggror
  16. Hello everyone. My team recently started using the leadwerks, so we are not totally familiar with it ... hehe In the project, we're adding some vehicles, equal to Viperscout sample. But we are having some problems. Here is what we did: 1. Finished the modeling of the car, export only the car whit a cubes to guide the wheels as pivot: 2. We use the max exporter to leadwerks, and exported the gmf, textures .dds and the .phy. 3. Soon after, we export two separate models of the wheel, the left and right, and put it in another directory. 4. In .lua file of the cara, we put the following code: require("scripts/class") require("scripts/loop") require("scripts/math/math") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) function object:UpdateMatrix() self:UpdateTires() end function object:UpdateTires() local speed for n=0,3 do if self.tire[n]~=nil then self.tire[n]:SetMatrix( self.vehicle:GetTireMatrix(n) ) if self.emitter[n]~=nil then self.emitter[n]:SetMatrix(self.vehicle:GetTireMatrix(n)) self.emitter[n]:Pause() if self.vehicle:TireIsAirborne(n)==0 then speed = math.abs(self.model:GetVelocity(0).z) speed = (speed - 4) * 20.0 speed = Clamp( speed, 0, 1 ) * 0.5 if speed>0 then self.emitter[n]:Resume() self.emitter[n]:SetColorf(1,1,1,speed) end end end end end end local pivot local suspensionlength=0.1 local springconstant=25.0 local springdamper=115.0 object.vehicle=CreateVehicle(object.model) object.tire={} object.emitter={} pivot=object.model:FindChild("tire1") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[0]=LoadMesh("abstract::tire_left.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("tire2") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[2]=LoadMesh("abstract::tire_left.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("tire3") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[1]=LoadMesh("abstract::tire_right.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("tire4") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[3]=LoadMesh("abstract::tire_right.gmf",object.model) pivot:Hide() end object.emitter={} object:UpdateTires() if world_transparency~=nil then if world_main~=nil then SetWorld(world_transparency) for n=0,3 do if object.tire[n]~=nil then object.emitter[n]=CreateEmitter(50,2000,Vec3(0,1,0),0,object.tire[n]) object.emitter[n]:SetPosition(Vec3(0,-object.tire[n].aabb.h/2.0,0)) object.emitter[n]:SetParent(model,1) object.emitter[n]:SetRadius(1,6) object.emitter[n]:SetWaver(1.0) object.emitter[n]:Paint(LoadMaterial("abstract::roaddust.mat")) object.emitter[n]:SetRotationSpeed(0.1) object.emitter[n]:Pause() end end SetWorld(world_main) end end object.model.buoyant=0 object.model:SetKey("collisiontype",COLLISION_PROP) object.model:SetKey("mass",1.2) object:UpdateTires() end We can see, witch it find the tires, and hide the pivot normally... But the problems are the following: the car does not fall, he is floating in air, not having this reaction to gravity. I try to change the mass and enable the gravity of it in the properties editor, but even so, when I apply, close and open again, it resets the settings. I wonder why this happening? Is there something wrong with the code, or I forgot something? And other detail, in the file viperscout.lua, has a line like this: object.turret=object.model:FindChild("turret") whats this "turret"? thanks
×
×
  • Create New...