Jump to content

2D - 3D Mouse projection


Blue Solitare
 Share

Recommended Posts

Thanks for the quick reply. I implemented the CameraProject() method from the example and things mostly work. The problem is with the glReadPixels() method. Is there another LE method that could be used to replace glReadPixels, it's really expensive. It also causes a problem in situations where the cursor is mousing over something other then the terrain, which is what I need to project to. I'm getting a false projection.

 

I'm using LEO, if it makes a difference.

 

Thanks,

 

Blue

Link to comment
Share on other sites

TPick pick;

if(MouseHit(1)) {
  HideEntity(character);
  if(CameraPick(&pick,camera,Vec3(MouseX(),MouseY(),200.0))) {
     PositionEntity(cursor,Vec3(pick.X,pick.Y+0.25,pick.Z));
  }
  ShowEntity(character);
}

 

You need use HideEntity() && ShowEntity()!

Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS

Resource War Developer [ dev blog ]

Link to comment
Share on other sites

Wouldn't hiding entities cause a flickering effect or cause them to go away all together?

 

What I'm trying to do is find a replacement for glReadPixels for two reasons:

1. It's slow and expensive

2. It reads the closets pixel to the camera (in my situation), which in many cases is not what I want due to having other objects in the scene. I only want to read the terrain pixels.

 

Is there a way (RenderWorld?) to only render the terrain, read my terrain, then render the rest of the scene?

Link to comment
Share on other sites

Wouldn't hiding entities cause a flickering effect or cause them to go away all together?

 

 

I use Hide and Show when casting from NPC's I have not noticed any flickering. As you can see in the two videos Here.

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

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...