Jump to content

Getting uv coords from ray pick?


scrypt
 Share

Recommended Posts

Topic pretty much says it. I could have sworn I saw it in a thread I read, :) somewhere... And I see that it was, I believe, granted as a feature request? But nonetheless I cant retrace my steps to it, so I thought I'd just ask.

 

In raycasting how does one go about aquiring if such is possible, the uv coords from a pick?

 

Thanx

 

P.S. Great engine by the way, I'm liking it more and more.

Link to comment
Share on other sites

The TPick structure returns the surface that the raycast has intersected so I'm guessing you could use this along with the surface commands like GetVertexTexCoords to retrieve info on the UV coords.

 

Never tried it myself but that would be my first approach. Hope this helps.

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

Thanks Pixel Perfect, I tried your suggestion as I agreed and considered it pretty much straight forward.

 

However... all I got/get from the "int::triangle" index, that pick returns is zero... no matter which face <_< I pick.

And surfaces need an index into the verts you wish to access.

 

So, it looks as though to move forward I'll have to use the surface/pick normal to to zero in on the uv coords :blink: .

 

Thanks though, it was a good idea/strategy.

 

Scrypt

Link to comment
Share on other sites

However... all I got/get from the "int::triangle" index, that pick returns is zero... no matter which face <_< I pick.

And surfaces need an index into the verts you wish to access.

Ah ok, thats a shame. Sounds like a bug to me. There have been several problems in the past with the pick structure population that were subsequently fixed. You might want to log that one!

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

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