How to make a third person character control walk based on where user is gazing through google cardboard in unity 3D - unityscript

I am making a VR model of my university campus using unity3D.
I have created a model of my university and now my task is to make the third person character move in the direction where user will be gazing.
EX: if I look straight I should keep seeing which ever comes in the way .
If I look at left the 3rd person character should be able to turn left.
that means depending upon my head movement it should walk.
PL NOTE : I will be using Google cardboard VR Gear
How can I achieve it? I know I have to make a script in C# / javascript but I am not so familiar with it.
Please suggest !!!

Add your character as child of camera so it can rotate according to head movement. Then add your movement script to camera object and write code to move in forward direction. you can use controller or trigger to move it.

Related

How to set a Sprite to a specific Frame in Godot

I have the Player move around and when he enters a new Room (via Instancing) his Sprite shows him facing in the Default direction (in my Case down). So If you enter a Room from any other direction then it looks weird, cause for a short Moment you can see the Player facing down even if you came from the right. How can I tell Godot to set the Player Sprite to a specific Frame in Code, so I can set it to the proper Frame for each Direction. I'm new to Godot and I used HeartBeast Action RPG Tutorial for my Movement. So it's using an AnimationTree and AnimationPlayer. I tried "set_frame" but Godot just says it doesn't know the Method.
If you are following the tutorial series I think you are following (Godot Action RPG)… You are using an AnimationTree with AnimationNodeBlendSpace2D (BlendSpace2D).
The BlendSpace2D picks an animation based on an input vector "blend_position". This way you can use BlendSpace2D to pick an animation based on the direction of motion or the direction the player character is looking at. For example, you can "idle_up", "idle_down", "idle_left", and "idle_right" animations, and use BlendSpace2D to pick one in runtime based on a direction vector.
Thus, you need to set the "blend_position" of the BlendSpace2D like this:
animationTree.set("parameters/NameOfTheBlendSpàce2D/blend_position", vector)
Where:
animationTree is a variable set to the AnimationTree.
"NameOfTheBlendSpàce2D" is the name of the BlendSpace2D you want to set (e.g. "Idle").
vector is a Vector2D with the direction you want (e.g. Vector2.UP).
This is shown in the episode 6 of the tutorial series (Animation in all directions with an AnimationTree).
You can find a reference project by HeartBeast at arpg-reference, where you can find a function update_animation_blend_positions that looks like this:
func update_animation_blend_positions():
animationTree.set("parameters/Idle/blend_position", input_vector)
animationTree.set("parameters/Run/blend_position", input_vector)
animationTree.set("parameters/Attack/blend_position", input_vector)
animationTree.set("parameters/Roll/blend_position", input_vector)
Here "Idle", "Run", "Attack", and "Roll" are BlendSpace2D, each configured with animations for the corresponding actions, and this function updates them in sync so that they are picking the correct animation.
As far as I can tell the code from the repository is further refactored from what is show in the tutorial series. This code from the repository is under MIT licence.

AutoCAD script: Find drawing position

Forgive my ignorance. I'm a web developer tasked with integrating an app with AutoCAD and I have no experience with the software or CAD files in general.
I have hooked it up to A360 and the Forge APIs and now I'm looking to modify drawings using scripts uploaded to the Design Automation API. What I need to do is add part numbers and some other data generated by the app to the drawings. I have the following script I've managed to get working which is a very basic version of what I need to achieve.
; Add a label to a drawing
-mtext 0,300 400,310 App data
Tag No: P1234567
Created: 29/09/16
; Define Attribute
-attdef
i
P1234567
tag
-
0,200
10
0
; end
This script adds an MTEXT and ATTDEF to a drawing with a bit of basic data. What I want to do is position the labels at the bottom right of the drawing.
Is it possible to get the position of the drawing from somewhere so the script can figure out where the bottom right is? Ideally it needs to work no matter where the creator has positioned the drawing.
Bonus points: I'd also like to put this data into the drawing metadata somehow, would this be beneficial and how would be the best way to achieve this?
Thanks in advance.
If you would still like to do it in Modelspace, and you can control the drawings, it is possible to achieve this by finding the position of blocks with specific names.
Example: http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-a-block-and-get-it-s-insertion-point/m-p/3309261#M302014

sf::View visibility Check

Ok, so I've been working on a game with some friends for a school project. We have used SFML.
I've been working lately on the camera and a tile implementations system and now I need them to work together.
The camera works like this:
I have two different sf::View, one for the game world and one for the hud. The one for the game world follows the player in the x-axis.
The tile system works in a way where it reads in a txt file and draw sprites based on the information from the txt file.
As it is now I always draw all the tiles, even if it's outside of the cameras view. Not good. I need a way to check if the tiles are outside of the cameras view before I draw them. How do I do this?
I did find this:
Get X and Y offset of sf::View
but I can't really wrap my head around how to make this info work in my game.
Any help would be really appreciated! :)
Mvh Elis
Managed to figure it out after finding this:
http://fr.sfml-dev.org/forums/index.php?topic=10590.0

How to use CRUD with Interactive 3d model? - Three.js

I am new to learn Three.js and I am not sure it's exactly suit for my needs!
I am creating web application using PHP to keep car accident details.
I was wondering if it's possible to have interactive 3d car object and I can mark the damage on the car with mouse click and post to server.(Create,Read,Update,Delete).
So when ever I open the client details I can see the damages that already mark on the car.
Could someone point me the right direction.
How can I achieve this?
You can have car model and you can write some javascript code to change this car model by mouse clicking. Problem is that you have to learn a lot about Three.js, 3d graphic and javascript. So the right direction is to start learning those 3 things. Three.js is not a 3d modeling tool so if you want to create car models in the browser you will have to write your own 3d modeling code. When you will have this Read, Update and Delete will just work. You will only have to add some code to write changes made in browser to your server.

Animating Multi-Part Object

I've got a model of a car imported into Unity. It's got multiple parts, and these have been organized into a hierarchy in the project explorer window.
I want to be able to "explode" the model - move each part outwards, so that each individual part can be seen.
Do you know how I can do this in one script? So far, I can use a translate function call to move individual parts, and I've had to make separate scripts for each part.
Any guidance on how I could do this would be great.
i dont know what you really want to do. if you want to make an car exlosion that you want to do it with a simple code you can use addForce function. it receives a paramter as a direction. you can use this code to throw parts of your car to diffrent directions and trigger the code in some event, but if you want something cinematic and controlled you should just start animating.

Resources