Jump to content

Decals and Camerapicking


Swampdonkey
 Share

Recommended Posts

Well my eval period is just about over.. It's been a blast playing with the LE engine. I'd like to thank Leadwerks for the opertunity to try out the engine and I'd like to thank its community for help when I initality got started. During my month I've tried out a few projects but most recently I started working on some Tower Defense ideas using the sandbox and lua scripting. While I ran into many problems, some mine, some not; I felt that LE was all around ready to take on a major project. However some things held me back from 'jumping on board', camerapicks seemed flawed and differentiated from the documentation way to much - so much in fact i was forced to try a diffrent approach which ultimately failed, I never got Decals to work even though I followed the docs to the tee - later reading the older forums I found out they been broke since sometime from 2.0 to 2.27 but was never mentioned in any documentation or offical post by the LE team. This lead to many many wasted hours on my part. Overall I would like to keep LE in the back of mind for future projects, maybe once I feel i can trust it more. Granted I was bound to lua whereas normally I'd use a more optimized compiler but my over experience was very positive and I look forward to checking out this engine again in the future.

 

And to those wondering about tower defense in LE, I can only say "HELL YES". In 3 weeks time we almost had a prototype working in pure lua script... thats gotta' count for something aye?

 

Anyways, enough babbling from me.. I leave you all with a screenshot from my test pad Tower defense attempt under the Leadwerks label.. Fully working AI and Camera Railing.

 

post-1-12670019716379_thumb.jpg

<-- gothasoft.com -->

Link to comment
Share on other sites

Nice screenie, I do like the look of that scene :)

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

I use always EntityPick instead of CameraPick, because then you can have FPS/3rd person camera with the same logic. Never had any problems with EntityPick.

 

I think 2D decals are pretty useless, as they are just flat and don't give the look of a real 3D decal.

Same goes for emitters. I will try to implement a 3D way for both, since smoke emitters need also collisions, so they don't go through ceilings, same goes for rain emitters.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Nice work.

 

I am not aware of any problems with camera picking. I would not be surprised if there is a problem with mesh decals. I have not used the technique in a long time, and it is a little tricky to set up a proper material for it. Will look into it soon.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

That is the nicest 'in game' shot I've seen in Leadwerks.

 

Fully working AI and Camera Railing.

Wow ... I think that's worthy of a video ;)

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

No, EntityPick doesn't use callbacks, it's just a simple function call and then you check the results:

	TPick pick;
if(EntityPick(&pick,eyemodel,3))
{
	TModel model=GetMeshModel(pick.entity);
	if(model)
	{
		pickedmodel=model;
		SetBodyGravityMode(pickedmodel,0);
	}
}

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Thanks Lumooja, most helpful information there.

On a side note - have you a clue what Camerapick is returning to the pick.entity class? At first i thought it was the entity handle but clearly it isnt, then i tried the surface handle; still not, last i tried the material handle again not. For optmization purposes I would like to use Camerapick over Entitypick since I'll have many diffrent structures to determine a mouse click and preforming a seperate Entitypick per structure per loop dosen't seem logical to me.

<-- gothasoft.com -->

Link to comment
Share on other sites

CameraPick returns also the mesh, like EntityPick. However, radius must be always 0 with CameraPick, not sure if it works with EntityPick.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Seems the problem i was having with Camerapick lay within the model itself, to many subobjects attached to it. Appears to be wroking now after optimizing the mesh!. Although i've now constructed a better way to handle these picks by hiding the world pivot and placing cubes within the meshes bounding box parameters and just simply checking against those cubes for fast picking.

<-- gothasoft.com -->

Link to comment
Share on other sites

The camera pick function is a convenience function that calculates coordinates and then calls LinePick(). You do not need to use the callback for any pick function. It only provides an extra method of control.

 

The pick structure contains the picked entity, position, normal, and surface (if a mesh was picked). This structure is documented in the wiki:

http://leadwerks.com/wiki/index.php?title=Raycasting

 

You may also find this useful:

http://www.leadwerks.com/files/Tutorials/CPP/Collision_And_Raycasting.pdf

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...