I'm using Networked A-Frame. Its great because I can see my freiends move around and all. But I was wondering if there is a way to do a 2d Movement in a 3d world?
What I mean is To move up, down left and right in small space without moving around in all 3D space? I really need trying to figure this out. I'm attaching an image as a example and link for networked aframe Networked A-Frame. Please someone help me?
Joseph
I honestly Don't know.
Related
I just started coding some basics in SharpDX (VB.net) and I already got it to Render a 2D triangle. And I know how to render other 2D stuff, but I want to create something in 3D where I'm able to rotate the camera around some cubes. I tried it, but failed at converting the 3D Space to screen coordinates. Now Here are my Questions:
How can I calculate a Matrix for Perspective projection?
How can I pass that Matrix to my Vertex Shader
How can I make the Camera rotate around the Objects when I drag the mouse over the screen?
Please explain these things to me and give some code examples. I'm just a Beginner in SharpDX and everything I found was just not understandable for me.
A few things you can do when you first start.
Firstly, there are some great examples you can leverage (Even in c# but you need VB) that you can use to learn from.
I suggest you look at this within the Sharpdx repository. Sharpdx direct 3d 11 samples
Within these examples (especially triangle example), it goes through the basics including setting up the device, the creation of simple resources to bind to your GPU and compiling the bytecode.
The samples though use the effects methodology, which is deprecated and as such once you become familiar with compiling code, I would advise moving away from this paradigm.
The more advanced examples will show you how to set up your matrices.
The last item you wanted to know about is mouse movement. I would advise just having a look at MSDN around mousemove events. You will need to bind one to your window/control and then read the deltas. Use those deltas to create your rotation/movement based upon this. Look into Vector3 (sharpdx), basically, you need to do this all in vector space and then create the various translation/rotation matrices from this.
Hope this is start.
Ultimately, when using a VR headset, I'd like for the camera to rotate around the object when a viewer's head moves. When I look up, for instance, I want to see the bottom of the object and when I look down, I want to see the top of the object. The google exhibit demos with cardboard have this feature. I'm a newbie when it comes to this stuff, so be gentle. If there are tutorials or literature you'd recommend to become more familiar with this stuff, I'm all ears.
Here's my issue. I am making a small car game in xcode. I am using around separate 20 .png images as my road. each image is around 600 x 1200 but the road itself is in the centre of the image and it's narrow and winding. I have no idea how I can get the car to detect where it has crossed the edge of the road. I really hope this is making sense to someone.
I don't have any code to share as I am completely stuck on how to do it, and I have been searching everywhere before I came here to ask.
I really appreciate some help.
Thanks
[EDIT** I have attached an image trying to illustrate what I am trying to achieve. As you can see all the white area is transparent as basically if my car crosses the the bounds of the road you die. Hopefully that makes a little more sense
Instead of using an image for your road, try using a single UIBezierPath, which you can construct from lines and arcs. You can then use containsPoint: to determine if any of the corners of your "car", return NO for that method.
I already have a function that can return a tile for a given position. I am trying to make it so that when I scroll around it will load new tiles on the fly. I am having trouble figuring out how to attack the problem. I am sure that someone must have done this before and I would prefer to not reinvent the wheel on this.
Can anyone point me to a tutorial or some example code?
If not, can perhaps help me figure out how to do this?
I am using Kobold2D and the map is not going to be static, it will be generated on the fly, Minecraft style.
CATiledLayer is perfect for this. However, I do not know if this will play well with Cocos2d.
I wonder if someone could tell me how to make it possible to move a camera in a 3D space when
the camera is rotated.
I am working on my own 3D engine (nothing fancy) and I can move the camera forward backward left right up down, thats all good.
However when I rotate the camera, it doesnt move in the direction that the camera is directed to.
Here is a picture that should help you understand what I mean:
http://www.xaid.se/camrot.jpg
Does anybody know how to make this work?
(If you're interested in what I'm working on, visit this site)
i'm not sure if i really get what you mean, but your problem looks like you want to move along the direction of the camera instead along one (main-)axis?
therefore my solution would be to store a vector which keeps the direction the camera is looking, and update this vector everytime you rotate the camera. now you can use your direction vector for the forward movement. position + vector*stepsize.
hope that helps a little bit.