Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Irrlicht question  (Read 1138 times)

0 Members and 1 Guest are viewing this topic.
Irrlicht question
« on: July 16, 2008, 11:20:17 pm »
  • =/
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2284
 Right, I've been thinking about this most of the night and have come to no conclusion on actually how to do it. In this screenshot:



 As you can see, when Leon is aiming, a transparent red line goes from the end of his gun, to the target for aiming. So, does anyone have any ideas, or for that matter, examples on how you could?
Logged
Re: Irrlicht question
« Reply #1 on: July 17, 2008, 12:16:53 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Vector of gun + Offset of laser source = Vector to emit beam at.

As for actually emitting it, there are numerous different practices that can be used. I think the most common one is 'picking' the first object that is hit when tracing a line between the lasers source and an infinite destination on the emission vector, then drawing a beam (usually just a simple billboard sprite) between the source and the intersecting object.

First google result for 3D picking, may help you: http://www.lighthouse3d.com/opengl/picking/ Irrlicht will no doubt provide an automated system for picking, have a look for it.

EDIT: After a bit of searching I believe what you wish to look into is irr::scene::ISceneCollisionManager::getCollisionPoint.
« Last Edit: July 17, 2008, 12:23:09 am by Infini »
Logged
Re: Irrlicht question
« Reply #2 on: July 17, 2008, 04:01:50 am »
  • =/
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2284
 Ah, thank you so much Infini... you've helped me so much that you are basically my savior. : )
Logged
Re: Irrlicht question
« Reply #3 on: July 17, 2008, 07:39:10 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
No problem.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.989 seconds with 45 queries.