Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 12:16:10 am
Xith3D CommunityXith3D InternalsDeveloper discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)A Couple Of Things
Pages: [1]
Print
Author Topic: A Couple Of Things  (Read 1000 times)
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« on: 21. August 2007, 01:15:19 pm »

There are a couple of things I would like to get cleared up.

1) Repeating Textures

     What is the simplest way to do this?


2) Picking

     There does not seem to be any fully implemented way to pick in Xith, besides picking through the screen (mouse).  What if a want to know if my entity has a brick wall in front of him, and my game isn't tile based?  A bit of a harder proposition: what about picking and knowing whether I hit the terrain or not?  That would be helpful to stop a character from just walking up a cliff, for example.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #1 on: 21. August 2007, 02:57:17 pm »

1) Repeating Textures
What is the simplest way to do this?
IIRC, just use texture coordinates outside the [0-1] bounds, and setting the Boundary mode to "WRAP"
http://xith.org/javadoc/core/org/xith3d/scenegraph/Texture.BoundaryMode.html
http://xith.org/javadoc/core/org/xith3d/scenegraph/Texture.html#setBoundaryModeS(org.xith3d.scenegraph.Texture.BoundaryMode)
http://xith.org/javadoc/core/org/xith3d/scenegraph/Texture.html#setBoundaryModeT(org.xith3d.scenegraph.Texture.BoundaryMode)

2) Picking
     There does not seem to be any fully implemented way to pick in Xith, besides picking through the screen (mouse).  What if a want to know if my entity has a brick wall in front of him, and my game isn't tile based?  A bit of a harder proposition: what about picking and knowing whether I hit the terrain or not?  That would be helpful to stop a character from just walking up a cliff, for example.
Maybe the "really public" API doesn't include this possibility, but the used algorithms can be used for that, of course.. Dig into http://xith.org/javadoc/core/org/xith3d/picking/PickingLibrary.html source code to see how it is done.

In fact what you ask is already implemented : picking from a screen coordinates just need an additionnal preprocessing step : creating a pick-ray from mouse coordinates and the view matrix. Is it correct, Marvin ?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 21. August 2007, 06:46:08 pm »

IIRC, just use texture coordinates outside the [0-1] bounds, and setting the Boundary mode to "WRAP"

Exactly. A value greater than 1 will repeat the texture and smaller than 0 will offset it.

Maybe the "really public" API doesn't include this possibility, but the used algorithms can be used for that, of course.. Dig into http://xith.org/javadoc/core/org/xith3d/picking/PickingLibrary.html source code to see how it is done.

In fact what you ask is already implemented : picking from a screen coordinates just need an additionnal preprocessing step : creating a pick-ray from mouse coordinates and the view matrix. Is it correct, Marvin ?

Yes. You can create an instance of PickRay through one of it's constructors. And maybe you'll want to create a subclass of GeometryPickTester, in which you pick only the parts of a geometry, that you want to be picked. You'll have to attach your KukananiGeometryPickTester instance to the PickingLibrary.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic