Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Help with CreateDecal and mousepicking  (Read 1623 times)
themanoffez
Community Member
*
Posts: 9


« on: March 31, 2010, 07:44:54 PM »

I've been trying to get some decals to work on some 3DS meshes, and while the decals show up, they aren't anywhere near the mesh I'm actually shooting at. I looked at everything I could think of, but there's not really much in the way of CreateDecal code out there for mousepicking.

Any ideas?

Here's my current code:

    Set ColRes = Scene.MousePicking(inX, inY, TV_COLLIDE_MESH, TV_TESTTYPE_ACCURATETESTING)
    If ColRes.IsCollision = True Then
        Pos.x = ColRes.GetCollisionMesh.GetPosition.x
        Pos.y = ColRes.GetCollisionMesh.GetPosition.y
        Pos.z = ColRes.GetCollisionMesh.GetPosition.z
        Normal.x = ColRes.GetCollisionNormal.x
        Normal.y = ColRes.GetCollisionNormal.y
        Normal.z = ColRes.GetCollisionNormal.z
        CreateDecal Pos, Normal, GetTex("Shot"), 32, 10000
    End If
Logged
Hypnotron
Customers
Community Member
*****
Posts: 1046


« Reply #1 on: April 01, 2010, 04:17:09 AM »

should you not be using the collision impact point and not the mesh position?
Logged
themanoffez
Community Member
*
Posts: 9


« Reply #2 on: April 02, 2010, 02:36:53 PM »

I tried using GetImpactPoint as well, but that doesn't seem to help much either. I'm using a 3ds mesh I exported from Sketchup, although I've tried some other 3ds meshes with no luck either.

Is there any demo of createdecal working with mousepicking? Because if there is, I sure can't find it.

Thanks!
Logged
Dimple
Community Member
*
Posts: 580


« Reply #3 on: April 02, 2010, 04:45:00 PM »

themanoffez,

Did Rocky's Oilrig Demo use mouse picking? I've an old copy of that but don't know if it works, haven't got VB6 on my laptop to try it with.

 
Logged

Using VB.NET, TV3D 6.5, VISTA
~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

- Baltasar Gracian
themanoffez
Community Member
*
Posts: 9


« Reply #4 on: April 02, 2010, 04:57:50 PM »

I tried to download that one but couldn't find a working link, I'd like to look at it even if it doesn't use mouse picking Smiley
Logged
Dimple
Community Member
*
Posts: 580


« Reply #5 on: April 02, 2010, 08:29:04 PM »

Here's the file hope it works okay.

The File
Logged

Using VB.NET, TV3D 6.5, VISTA
~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

- Baltasar Gracian
themanoffez
Community Member
*
Posts: 9


« Reply #6 on: April 07, 2010, 01:09:53 PM »

Thanks for posting that, unfortunately it doesn't use mousepicking either, only bsp collision detection Sad

I also noticed that the shot decals on the bsp don't match up much closer than what is happening for me either, they always seem to be a foot or more off.
Logged
Dimple
Community Member
*
Posts: 580


« Reply #7 on: April 07, 2010, 07:53:30 PM »

Your welcome,

Have you had a look at this post, I'm not really sure if it would help or not.

http://www.truevision3d.com/forums/tv3d_sdk_63/solved_problem_with_mouse_collision-t12281.0.html;msg85859#msg85859
 
Logged

Using VB.NET, TV3D 6.5, VISTA
~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

- Baltasar Gracian
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks