-
Posts
679 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Marcousik
-
-
mmh I don't get it to work.. Something must be wrong but I don't know what.
But I could get it running by creating 2 differents models, but maybe worse for performances.
Quotelocal roadModel = Model:Create()
-- roadModel:SetViewRange(Entity.FarViewRange)
roadModel:SetShadowMode(0)
roadModel:SetCollisionType(Collision.Scene)
local surface = roadModel:AddSurface()
local surfaceB = roadModel:AddSurface()
local surfaceS = Surface:Create()-- road:
surface:AddVertex(v0, n, Vec2(0,0)) --0
surface:AddVertex(v1, n, Vec2(1,0)) --1
surface:AddVertex(v2, n, Vec2(1,1)) --2
surface:AddVertex(v3, n, Vec2(0,1)) --3
surface:AddTriangle(0,1,2)
surface:AddTriangle(0,2,3)
surface:Update()-- bankD
surfaceB:AddVertex(ve_1, n, Vec2(-1,0)) --0
surfaceB:AddVertex(v0, n, Vec2(0,0)) --1
surfaceB:AddVertex(v3, n, Vec2(0,1)) --2
surfaceB:AddVertex(ve_2, n, Vec2(-1,1)) --3
surfaceB:AddTriangle(0,1,2)
surfaceB:AddTriangle(0,2,3)
surfaceB:Update()-- bankG
surfaceB:AddVertex(v1, n, Vec2(1,0)) --4
surfaceB:AddVertex(ve4, n, Vec2(2,0)) --5
surfaceB:AddVertex(ve5, n, Vec2(2,1)) --6
surfaceB:AddVertex(v2, n, Vec2(1,1)) --7
surfaceB:AddTriangle(4,5,6)
surfaceB:AddTriangle(4,6,7)
surfaceB:Update()surface:SetMaterial(self.RoadMaterial)
surfaceB:SetMaterial(self.BankMaterial)-- roadModel:UpdateAABB(Entity.LocalAABB+Entity.GlobalAABB)
local mat = Mat4()
surfaceS:Add(surface, mat)
surfaceS:Add(surfaceB, mat)
surfaceS:Update()
local shape = Shape:PolyMesh(surfaceS) -- THIS RETURNS shape == nil -- I don't know why
roadModel:SetShape(shape)
shape:Release()
-
thx, Yes I tried that.
But then I lost the 2 different Materials applied on the 2 different surfaces !
Is there something else ?
-
How should I set a complete polymesh shape with a script on a model with 2 surfaces?
I construct the shape like this:
local surf1 = Model:GetSurface(0)
local surf2 = Model:GetSurface(1)
local Shape1 = PolyMesh(surf1)
local Shape2 = PolyMesh(surf2)
Model:SetShape(--- ??? ----)
How to I set the two shapes on one model ?????
Thx for help
-
So yes it works, a showcase was created simply by posting a new video.
-
Ok I understood that reversed, post here and it generates in video section ! I will try what you described
-
HI Josh
Here is video:
Edit: Can't see it there....
-
There are still people (I am one of them ^^) who still work with LE4.6 and try to build something / finish what they began
I spent hours learning how to use it and I made progress in building a game, so that I want to finish it.
And there is the very positive argument that the actual version 4.6 works stable and it will need a looooong time until the new baby Ultra keeps a way without updates required.
So I enjoy working with 4.6
- 1
-
Quote
I don't know why Josh wouldn't just
Because he is completely concentrated on coming forward with Ultra engine.
We all (are/have) missing a few thing in the actually LE that could made the editor just top, but well.
Do you think about publishing your soft-Particles shader or make a tuto on this ?
- 1
-
Soft-Particles would be a must for clouds simulation colliding with mountains uns so much more.
(sorry no idea how to help)
-
Quote
A scene with 1000 CSG brushes will run much faster than a scene with 1000 models.
Uh? ?
-
https://www.leadwerks.com/learn?page=API-Reference_Object_Joint_GetTargetAngle
Seems in editor not to be recognized, so no usable, can that be corrected?
-
Quote
When I run the ragdoll with SetParen, assigning as parent of the bone the rigid body. The ragdoll looks decent. The thing is that when I finish the ragdoll, I can't use animations like standing up. The skeleton is already related to the rigid body.
Ok. Did you try to unparent with SetParent(nil) ?
-
Quote
Then it is impossible to release the skeleton to apply an animation in which for example after a fall an animation of standing up is activated.
Sorry this is not clear for me... Do you mean "...use the skeleton to apply an animation" ?
I don't understand why you could not use the skeleton after the ragdoll goes to end ? Do you ?
-
So in the theory I would try to release the joints and then play a simple animation to awake the character.
If you can't release the joints, maybe try to set the friction to 0, so that the joints don't generate any force, just release the control.
And I would try to Hide() the boxes to avoid strange collision problems, and to set the Mass to 0 after the ragdoll animation is finished.
- 1
-
Features:
- MAP is 4096x4096 / all options on HIgh
- The forest is randomly generated, big, dense and it feels natural.
- 30 FPS average
- It is relaxing
- 3
-
Estaba preguntando sobre la colisión si escribes algo para cambiarlo, ya que puedes pasar por debajo de una caja cuando te agachas y no puedes si te paras.
- 1
-
Hey Yue how did you manage to change the shape by crouch/stand ?
- 1
-
Quote
Now you get to see what I have discovered long ago. The place your are selling matters more than the actual product.
And the scandal occasionned by selling a broken version of Cyberpunk 2077 on PS4 - whatever what everyone think about that - shows that not even quality is needed if you do an intense ad campaign to become rich & successfull. This is so crazy today.
-
Cool.. Whats about the licens e of that shader ? Commercial free ok?
-
That is a nice idea, I will test this thx
- 1
-
-
Quote
An easier and more accurate way may be to grab each tire position and draw decals on the terrain at those locations.
Thx, yes that was my method but it is not 100%. Calculatoin should be a mix out of velocity and rotation but I can't get it complete in my mind.
I used a modified code from the decals used for the bullets tracks on walls. It runs ok if the car stays in a "normally predictable" line of drive but not if the car is suddenly sliding like in the gif.
[Sorry I had problems by uploading / deleting example video]
Quotelocal TirePos0=self.Tires[0]:GetPosition(true)
local TirePos1=self.Tires[1]:GetPosition(true)
local TirePos2=self.Tires[2]:GetPosition(true)
local TirePos3=self.Tires[3]:GetPosition(true)local DecalPosY0=self.Terrain:GetElevation(TirePos0.x, TirePos0.z)
local DecalNormal0=self.Terrain:GetNormal(TirePos0.x, TirePos0.z)
local DecalPosY1=self.Terrain:GetElevation(TirePos1.x, TirePos1.z)
local DecalNormal1=self.Terrain:GetNormal(TirePos1.x, TirePos1.z)
local DecalPosY2=self.Terrain:GetElevation(TirePos2.x, TirePos2.z)
local DecalNormal2=self.Terrain:GetNormal(TirePos2.x, TirePos2.z)
local DecalPosY3=self.Terrain:GetElevation(TirePos3.x, TirePos3.z)
local DecalNormal3=self.Terrain:GetNormal(TirePos3.x, TirePos3.z)local TireTrace0 = Decal:Create(self.TireTraceMat)
-- local TireTrace1 = TireTrace0:Instance()
local TireTrace2 = TireTrace0:Instance()
local TireTrace3 = TireTrace0:Instance()
-- TireTrace0:SetScript("Scripts/Objects/Effects/BulletMark.lua")
-- TireTrace1:SetScript("Scripts/Objects/Effects/BulletMark.lua")
TireTrace2:SetScript("Scripts/Objects/Effects/BulletMark.lua")
TireTrace3:SetScript("Scripts/Objects/Effects/BulletMark.lua")TireTrace2:SetPosition(TirePos2.x, DecalPosY2,TirePos2.z,true)
TireTrace2:AlignToVector(DecalNormal2,2)
TireTrace2:SetRotation(0,self.entity:GetRotation().y-((10+Vit_locale.x*3)* self.turning),0) -- TOP VIRAGE GAUCHE cadTireTrace3:SetPosition(TirePos3.x, DecalPosY3,TirePos3.z,true)
TireTrace3:AlignToVector(DecalNormal3,2)
TireTrace3:SetRotation(0,self.entity:GetRotation().y-((10+Vit_locale.x*3)* self.turning),0)-- System:Print(math.abs(Vit_locale.x*20))
local mat = TireTrace2:GetMatrix()
mat[0] = mat[0]:Normalize() * 0.1--math.max(0.1, 0.2 * math.abs(Vit_locale.x))
mat[1] = mat[1]:Normalize() * 0.1
mat[2] = mat[2]:Normalize() * 0.2 * (self.vitesse/5)
TireTrace2:SetMatrix(mat)mat = TireTrace3:GetMatrix()
mat[0] = mat[0]:Normalize() * 0.1
mat[1] = mat[1]:Normalize() * 0.1
mat[2] = mat[2]:Normalize() * 0.2 * (self.vitesse/5)
TireTrace3:SetMatrix(mat)
-
I tried to write a script function to trace tires tracks.
Pretty easy with decals applied on Terrain if the car drives straight forward.
But how to calculate the tracks rotation/ direction of such a mouvement??? Any suggestions?
-
I worked on this and it runs ok in this code order:
DISPLAY was the variable I wanted to save written.
Quotelocal path = FileSystem:GetAppDataPath().."/MyFile.txt"
FileSystem:CreateFile(path)
local stream = FileSystem:OpenFile(path)if (stream) then
stream:Seek(0)
stream:WriteLine(DISPLAY)
-- stream:Seek(0) -- debug
-- System:Print(stream:ReadLine())
stream:Release()
end
Set Shape with script
in Programming
Posted
> I got it from there: https://www.leadwerks.com/learn?page=API-Reference_Object_Surface_Add
> No it is not needed.
Thx for reply.
I don't know where is the problem. In the editor you can easily collapse models with different surfaces/materials and generate a polymesh shape.
But seems not possible in script. Because collapsing make the entire model with one unique material.
I got the shape to be right generated with this:
So I created 2 different models with each one one surface and it runs ok.