Instantiate a texture in the Unreal Editor - unreal-development-kit

I'm trying to create a vehicle which throws a ball (or, say, a spherical projectile) when clicking. I already have this vehicle doing the right thing, but I'd like it to throw a yellow-colored ball. I created a yellow texture but I don't know how to apply it specifically to the projectile.
I have to run the map on Unreal Tournament 3, so I may not be able to use the Unreal Development Kit.
Do you have some clues or an idea on how to do that?
Thanks

You'll have to plug your Texture into a Material and assign that Material to your projectile mesh. You can do that in the editor, or you can override the mesh's materials in code inside the the mesh component by adding entries to the Materials array, e.g.:
Begin Object Class=StaticMeshComponent (or SkeletalMeshComponent) Name=ProjMeshComp
StaticMesh=<your mesh>
Materials(0)=<the material you created>
End Object

Is the projectile you are shooting a custom projectile?
If it is, look in your projectile class for a particle system component or a static mesh component reference similar to the answer Phillip posted. You will see something like:
ParticleSystem'SomePackage.SomeGroup.AssetName'
//or
StaticMesh'SomePackage.SomeGroup.AssetName'
The GroupName might not be present.
Then open up your editor and in your content browser find the package (in this case SomePackage). Right click it and be sure to Fully Load it. Now you should see your ParticleSystem or Static Mesh. If its a particle system, you need to edit the mesh module of the particle in cascade to use your material; otherwise you just reassign the static mesh material as usual.
If its not a custom projectile, you need to figure out which projectile class you are using and then do the above; a good starting place is the UTProjectile hierarchy of code.

Related

Projecting a photo as a texture onto a model in SketchUp?

SketchUp has many third party tools and add-ons, so my question is if there is already a tool to do the following task.
Let's say I'm modeling a building project and I have the 3D-model done. Then the actual construction takes place and I have some photos of the project being partially done. So I take one of the photos and match the 3D-model camera view to it exactly. I want then for the photo to be projected onto the visible 3D-scene as a texture. Obviously, so that I could then move the scene/camera to a degree, while preserving some resemblance of how it actually looks in real world.
Is there already a solution to make it possible?

How to create map marker to show multi users' facing direction by here sdk?

I want to create a mobile application that can show where is your friends and in which direction they are facing. I want to use positionIndicator at first but I can't create one more positionIndicator on the map view. Then I turned to MapMarker, But I found I can't rotate it and scale it. And I tried MapLocalModel, but I don't think it's a good idea to use a 3d module to render a 2d object. Then I think I should create a new MapObject class. But the constructor of MapObject is package protect. I can't call it or override it. So, what's the correct way to implement it?
MapLocalModel in general is the right approach for a marker which could be rotated. Agree that for 2D object MapLocalModel is not the best approach however the alternative would be rotating the image used for MapMarker itself which might also have some performance hit.

Archilogic material preset choices in 3d.io viewer

I would like to create a web app that lets the user choose between different presets for floors and walls in an archilogic 3D scene.
https://spaces.archilogic.com/model/template/new?modelResourceId=f67ffde0-278e-11e4-9f8c-7dda0d61ae4a&mode=edit&view-menu=camera-bookmarks&main-menu=interior&logo=false
Just like in this editor, however, I need the materials menu to be simpler (user chooses from different preset textures which were uploaded earlier by the admin with the corresponding diffuse, spec, normal, and alpha maps).
I was browsing through all the repos of archilogic but couldn't find the source code of the 3D editor in order to make it simpler.
Does anyone know if it's available, if not, which direction should I be headed in order to develop such an app?
This is a feature that still is on the roadmap and not done yet, but there are ways to accomplish something similar.
So above all, the following description is due to all this not being ready and polished yet. It's an experimental way of getting to your goal.
Let's break this down.
Predefined materials
Archilogic has a long list of pre-defined materials right now that you can pick from. They're agnostic to the type of architectural element, so you can use any material on any element. Here is the list of available materials.
Floor & ceiling
Floors and ceilings are contained in a single element with an io3d-floor component.
So assuming you've got your floor and ceiling in the elem element, you can do the following to select a pre-defined material:
elem.components['io3d-floor'].data.material_top = 'wood_parquet_oak';
elem.components['io3d-floor'].update()
this will change the floor material to the given pre-defined material, in this case "wood_parquet_oak". For the ceiling material, change material_top to material_ceiling.
Walls
Walls work pretty much the same, but the properties are material_front and material_back instead of material_top and material_ceiling.
Other architectural elements
For other elements, you can probably work it out by looking what is available as properties in .data of the associated component (e.g. io3d-wall for walls).
Custom materials
This is a little harder to get right as there's a bunch of properties involved in making a custom material.
Assuming you have uploaded textures somewhere, you'd define the material like this:
elem.components['io3d-floor'].data.material_top = {
mapDiffuse: "https://example.org/texture.hi-res.gz.dds",
mapDiffusePreview: "https://example.org/texture.lo-res.jpg",
mapDiffuseSource: "https://example.org/texture.source.jpg"
}
You can also give it additional parameters, such as size: [3,3] scaling the texture to cover 3x3 meters in the model before repeating itself or passing normal maps or specular maps, but I exclude these for brevity.
Note: You can use this kind of material definition for anything that also accepts the pre-defined materials mentioned above. It's important to follow the naming convention and you need to have a gzipped DDS texture available as well as JPEG versions.
The 'Source' image is optional, but the other two have to be present or it won't work.
Summing it up: This functionality isn't fully ready yet (as you can tell by the quite contrived way of getting this to work) but this workaround will do until a better way is going to be available.

How to display points with QT3D?

Qt3D makes it very easy to display some mesh primitives:
m_torus = new Qt3DExtras::QTorusMesh();
but I would just like to display a collection of points. I haven't seen anything like
m_points = new Qt3DExtras::QPoints();
Is there a way to do this without writing lower level OpenGL?
Don't know if this is what you're looking for but check out Qt3DRender::QGeometryRenderer. I use it in a project to display map lines in a 3D scene.
There is a method to define how the vertex buffer data shall be rendered (where I use Qt3DRender::QGeometryRenderer::LineStrip instead of Qt3DRender::QGeometryRenderer::Points):
Qt3DRender::QGeometryRenderer::setPrimitiveType(Qt3DRender::QGeometryRenderer::Points);
AFAIK, There are no simple primitives like lines or points available in Qt3D 2.0, because there is just no one-size-fits-it-all solution. If you are lucky, someone will step up and add something to extras, else you have to write your solution yourself.
Qt Interest Mailing List Nov 2016 - Lines in Qt3D
There is however, a pcl point cloud renderer project on github!

Qt OpenGL data synchronization / Model/View implementation

I am trying to develop an application with Qt 5.5 and OpenGL. The basic work of the application will be to load simple objects, modify their positions in a scene and save them together with other attributes (material, name, parents/child relations etc...).
The only thing I am struggling about for a week now is that I really don't know how I should take on the problem of synchronizing data. Let's say I have some kind of SceneGraph class which takes care of all SceneObjects. Those SceneGraphs should be rendered in a SceneView-Widget which can be used to modify it's Objects via transformations. Now how would I tell every SceneView that an Object changed it's position?
I thought of the Model/View architecture for a moment but I am not really sure how this implementation should look like.
What would be the best way to handle Objects like that in different Windows/Widgets but still have one single piece of data?
SceneObject:
Holds the mesh-information (verticies, uvs, etc..)
Has a name (QString)
Has a material
Has a transform storing position, rotation and scaling information
(Important: these datatypes should be synchronized in all views)
SceneGraph:
Contains different SceneObjects and is passed to SceneViews
SceneView:
The QWidget responsible for drawing the Scene correctly in any QWindow.
Has it's own camera to move around.
Handles UserInput and allows transformation of SceneObjects.
You could use the signal and slot to observe position updates of SceneObjects and process them in SceneView.

Resources