I am trying to spawn a ball in the world dependant on where the player (box) is at the time. to do this i need to know the position of the box and when i press a button the ball shall appear in the center of the top face of the box.
So for this i would need to be able the Y axis of the position also, and after searching online i cant find anything for help.
Anyone know how to help me with this?
Thank you.
It's very difficult to give you an accurate answer without any code.
However something along these lines is what you are aiming for:
NxVec3 ballSpawn = box.getGlobalPosition();
ball.setGlobalPosition(NxVec3(ballSpawn.x, ballSpawn.y+boxHeight, ballSpawn.z));
The PhysX SDK Documentation has an excellent search function for the basics.
Related
So I’ve been trying to make a target type game where you click on a target and it tells you how accurate you were and where you clicked each time. After a while I have run across an issue where I couldn’t find out where on the sprite I clicked the target on. I tried googling it but all that comes up is detecting when the sprite is clicked. If anyone can help me it would be very appreciated. Thank you.
I think this is what you want: Create a variable (I'll call it accuracy). Then create an event for "When this sprite clicked". Have it set your variable to "distance to mouse pointer". This will give you the distance from the mouse click to the center of the sprite.
I'm using this library
As of now I have a point that follows the mouse, but it only kind of works because I assume the window will be 500x500, and the point is never directly behind the mouse because (0,0) on the graph is not (0,0) on the window.
If I could just figure out what the graph origin is relative to the window's coordinates, then I could fix everything, but I can't seem to figure out how to do that. Graphics.Rendering.Chart.Renderable seems relevant, such as the "Pick Function" and RectSize, but again I'm not sure how to actually get anything relevant from it. Graphics.Rendering.Chart.Backend may also be relevant.
Or this may actually be something to solve with gtk? I don't know.
Please help, this has been killing me.
EDIT: Here's my current code if it helps
I am looking to achieve the following :
when an application stars up, I want it to slide in from the left of the screen
Is this possible to do in linux ? How do I go about achieving it ? I could not find any resources online, so if anyone could point me in the right direction, that would be great.
I am open to programming a solution for this too. It would be great if i can get an answer on how to program something like this.
Presumably you have control over the placement of the window. Place the window off screen, then set up a loop that moves it over one pixel at a time. Exactly how to do that depends on your GUI toolkit.
So, basically, I'm trying to figure out a way that I can draw lines (say, representing the flight path of an RC plane or something) onto Google Earth using KML. Here's the kicker though: I want to give it an initial location, and then check somewhere to see where to continue drawing the line to, draw the line, and leave it be. Once it's done, I could then move it around.
Ex:
Starts at a point A in google Earth
Checks File XYZ.kml on //someserver
XYZ.kml has updated coordinates to draw to
Google Earth pulls in those coordinates and extends the line
Repeat 2->4 until complete
View completed flight path from 3rd person.
Does anyone have any ideas on how to do this? It seems like it can change the location of a model or something in this fashion, but you would have to watch it first person. I haven't been able to figure out how to get this particular functionality to come out right.
You have a few ways of doing this, here is just 2.
Create a LineString via a networkLink and then use the Update feature to update your LineString (ie replace with new version)
Create a LineString and then use .getCoordinates().pushLatLngAlt() to build upon it.
Edit: Sorry, as pointed out in comments, Option 2 is for GE Plug-in, not standalone version
See this SO question for some help on using option #1
See this SO question for more info on option #2
I need help for, scribbling on the webpage i.e where ever the user moves on the uiwebview there it should draw a line according to the touch moves.
Is this possible.
Can any one please help me in this.
Thanks,
Mrudula.
yes it is possible just you have to write uiWebView.scrollView instead of uiWebView for getting coordinates of uiwebview.
I started working on something sort of like this. It doesn't currently let you "draw", but it does let you detect and record relative touch coordinates so that you can scale them correctly when zooming in. The DSAnnotationView object lets you provide a custom UIView to be toggled at the annotation point. Check it out here: https://github.com/justindarc/WebViewAnnotations
-Justin