-
Posts
4,816 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by AggrorJorn
-
Well done, you are making progress. Some feedback on your code and a few suggestions: Have an array which holds enemy positions. You are currently creating a new AABB from scratch, which is fine. The sphere however already has an AABB and you can simply retrieve it by using GetAABB(). Saves you from making an AABB from scratch. But that is up to you. A Callback function no longer has acces to the 'self' variable. That is why you can simply provide an extra variable which either holds the script's entity. You can try it out. When that works, we have a look at the drawing part. **EDIT: added a simple timer in the update, so that you can control how often the enemy table is updated. --An array which holds the enemies. This array is empties every update before being filled again. Script.enemyEntities = {} Script.timer = 0 Script.timeUntilMinimapUpdates = 0.2 function Script:Start() self.miniMapSphere = Model:Sphere(8,self.player) self.miniMapSphere:SetScale(50,50,50) self.miniMapSphere:SetPosition(self.player:GetPosition(true)) --Parenting the sphere to the player, means we don't have to update the position ourselves again. self.miniMapSphere:SetParent(self.player) self.miniMapSphere:Hide() end function Script:UpdateWorld() self.timer = self.timer + Time:GetSpeed() if self.timer > self.timeUntilMinimapUpdates then self.timer = 0 self.enemyEntities = nil local AABB = self.miniMapSphere:GetAABB(1) --We pass along the entity that our current script is attached to world:ForEachEntityInAABBDo(AABB, "Callback", self.entity) end end --A callback function has lost the reference to 'self', that is why pass in the 'self.entity' at ForEachEntityInAABBDo function Callback(entity, extra) if entity:GetKeyValue("type") == "enemy" then table.insert(extra.script.enemyEntities, entity) end end
-
Try something like this. You are currently using a certain area around you to show as a map. Place a sphere as a child of your player and make it invisible (or partially transparent for debugging) The sphere needs to be roughly the size of the minimap you want to display. For example 4 meters wide. In your minimap script, reference the sphere and perform ForEachEntityInAABBDo every second (or as often you would like to update the minimap). The entities returned by the above function can now be looped over Check if it is an enemy (GetKeyValue could be used) Since AABB is a box and not a sphere, do a distance check to the enemy. If it is within the radius of the sphere, it should be shown on the minimap. The method above is just a way to get a list of entities that are near you. The distance check is to further finetune the result. See if you can get this working first before worrying about drawing the positions of the enemies.
-
How about window key + up arrow key?
-
The first thing you need to is gather information about which enemies are near you and should be projected on the minimap. one way is to gather enemies is using https://www.leadwerks.com/learn?page=API-Reference_Object_World_ForEachEntityInAABBDo Or you can loop over all enemies in an array, and check the distance to the player. second step is adding this information to the shader. I have never added an array of positions to a shader (I recon something like this should be possible: uniform vec2 enemyPositions[2];) but as an alternative you can add several enemy positions.
-
Control enter to switch between fullscreen and minimizes Control + Enter and then control + enter to reset size.
-
I mean even before that. Is the 3dsxmax scene referencing the renamed textures?
-
So you are exporting the model and than rename the textures? If so, how would the model know that you renamed your textures. The texture need to have that name before you export the model.
-
I am not entirely understanding this question. Your diffuse texture is visible in the screenshot your provided but you are sayin it is not using it? As for the bump and specular not automatically added to the material. I think Leadwerks uses a postfix to map bump and specular textures in a material. Try giving your textures the following names with a postfix: myTexture_diff myTexture_dot3 myTexture_spec
-
In that case, I would file a bug report because that should be happening automatically. Are you using Linux btw? Because the automatic mapping only works in windows. As for not seeing any shadows. Open the material for your model. Is the Cast shadow option enabled? Open the properties tab for your entity, under the appearance tab set cast shadows to Dynamic.
-
According to the documentation it should do this automatically, but there are some conditions: https://www.leadwerks.com/learn?page=Tutorials_Editor_Models-and-Animation Can you check if you have the following: The fbx model references your texture. That texture is in the same folder as you model.
-
There is a materials folder by default. What you describe already happens. However you need to make a material first. If you import a model with textures, material files are even created automatically.
-
Are you using Git in combination with LFS to store larger assets?
-
You are correct. The sample lacks the actual demonstration of the function. Something like this would be needed. (haven't tested it) --Create a window window = Window:Create() context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:Move(0,0,-3) local light = DirectionalLight:Create() light:SetRotation(35,35,0) model = Model:Box() model:SetColor(0.0,0.0,1.0) while true do if window:Closed() or window:KeyHit(Key.Escape) then return false end if model ~= nil then model:Turn(0,Time:GetSpeed(),0) end --Clears the current world if window:KeyHit(Key.Space) then world:Clear() end Time:Update() world:Update() world:Render() context:Sync(false) end
-
We need more information to help you What is your exact error? Lua or C++ Screenshots? Log file (in /Documents/leadwerks) What is disabled?
-
Oculus Rift vs. HTC Vive: Which is the one true VR headset?
AggrorJorn commented on Josh's blog entry in Development Blog
I would still go for the Vive because of room tracking. Even with little space, I can see far more potential in simulations. -
You need to clear the current world first. https://www.leadwerks.com/learn?page=API-Reference_Object_World_Clear
-
Wouldn't this be useful for the documentation somewhere here: https://www.leadwerks.com/learn?page=API-Reference_Object_VR
-
As I said, Leadwerks rewrote all documentation for the new system. It is perfectly possible small details are forgotten. In the old documentation you see how the Entities member is listed: http://web.archive.org/web/20150502074238/http://www.leadwerks.com:80/werkspace/page/documentation/_/command-reference/world
-
No. All the documentation found here: https://www.leadwerks.com/learn?page= is part of Leadwerks 4.x . It is just a new documentation system which was filled from scratch. So some information in the old documentation website might not be written in the new documentation system. Adding comments to pages would be nice, but for now we would have to file a bug report. Things get fixed very quickly if described properly. Example.
-
This information used to be in the documentation btw. I would expect a find the variable 'entities' here somewhere: https://www.leadwerks.com/learn?page=API-Reference_Object_World
-
This is something I have always found kinda odd when working with C++. I would have this massive switch/case list to get certain entities from my scene. Somehow that feels clunky. But even if there were an official function for this, it would probably do something similar in the background.
-
I haven't tried it myself but it might be in a different template. What template did you select when creating your project? If you have chosen blank project, then it is not included. Look for a template that contains the VR/player model. Create a new project and just copy the models from there to your existing project.
-
Can you confirm that the teleport.pfb exists in the required location of your project? So yourproject\models\vr\
-
That actually makes sense. Never realized this. A small preview window of what that camera is looking at would be nice too. Lets hope Le5 will have this.