I want to make a shape that can't be constructed using the SceneKit build in geometry models so I want to use some other 3D modeling program for that. I am interested if those models (created for example in Blender) can act as models that can be created directly in SceneKit. I want to be able to apply materials and change the object's color in code, and want to know beforehand if this is possible with imported models.
I know I can export the model in .dae (Collada file) and like this I can for sure use the model, but can't change its material.
If it is possible to change it in some other way I would appreciate if you could briefly explain how the object should be exported from Blender (in which format).
Actually yes you can change the material in a Collada (dae) format.
The materials are contained in the class SCNMaterial.
Here are the methods you can use to access the material:
First you have probably the easiest method of material access:
SCNNode.geometry.firstMaterial
This method gives your the first material that the object is using.
Next you have entire material access:
SCNNode.geometry.materials
This method gives you an NSArray containing all the materials that the object is using.
Then finally you have the good'ol name access:
[SCNNode.geometry.materialWithName: NSString]
This method gives you an NSArray containing all the materials that the object is using.
And in the apple docs:
What is SCNNode.geometry? Find out here
Material access and manipulation.
A side note:
To actually control the color/image of a SCNMaterial you need to use SCNMaterialProperty
A SCNMaterial is made up of several SCNMaterialPropertys.
For more info please read the docs
Related
https://github.com/highcharts/highcharts-vue
I don't see examples of these in the demo and there is nothing mentioned in the docs. I'm wondering if it is simply not possible or just not demoed because of their more complicated nature.
I will also need to use Charts appendData prototype to make a line chart real-time. Is this possible using the wrapper? I'm thrown by the following in the docs but not sure it it's directly related;
You can access the Chart object instance if necessary (e.g when need
to get some data or use any of Chart.prototype functions), by calling
specific Vue component instance chart field, but it is not supported
to update the chart using its built-in functions
Indeed, the highcharts-vue package supports all official modules included in Highcharts, so it's not necessary to produce every demo from demos site using Vue wrapper. I made the examples with gauge and heatmapseries specially for you, so please take a look on them.
I will also need to use Charts appendData prototype to make a line chart real-time. Is this possible using the wrapper?
A component is watching for changes on provided chart configuration, so if you will update your data (e.g by pushing new points into a series.data), then highcharts-vue will detect it, and automatically update the chart. That's the most recommended way of implementation. If you would like to use some Chart's or Series prototype functions, of course you can do that, but please note that causes inconsistency between the chart data and the data defined within component. Just need to access chart's reference like it is described in Chart object reference section.
Live examples:
https://codesandbox.io/s/vue-template-uqu1p (Gauge),
https://codesandbox.io/s/vue-template-8z2f5 (Heatmap)
I am trying to build a custom dataset-loader, which laods ICDAR-Dataset.
My frist step was to embed a dataset inside my loader as suggested also
here in this post, but the problem is that you have to implement all the nice features that the tenfsoflow-2 class "Dataset" offers manually.
My second try was to subclass the Dataset-Class, something like:
class MyDataset(tf.data.Dataset):
def __init__(self):
super(MyDataset, self).init()
def preprocess_images(self):
pass
But the problem is i did not find any documentation what dataset-class internally really does, the only implementation i found was this one.
So question is does anybody know how to build a custom "dataset" in tf2 by subclassing tf.data.Dataset.
By the way i also tried tensorflow_datasets, bit it does not really worked, shince it will downlaod the dataset, and split them manually which is in this is alreay seperated by train and test and also ICDAr can not be downlaoded without registration.
The content of the ICDAR-Dataset is as following:
An Image
A List of all texts in each image
A List of Bouding-boxes for each text in each image
Image:
#https://rrc.cvc.uab.es/?ch=4 owns the copyrights of this image.
Words and bounding boxes for the above image:
377,117,463,117,465,130,378,130,Genaxis Theatre
493,115,519,115,519,131,493,131,[06]
374,155,409,155,409,170,374,170,###
492,151,551,151,551,170,492,170,62-03
376,198,422,198,422,212,376,212,Carpark
494,190,539,189,539,205,494,206,###
374,1,494,0,492,85,372,86,###
Thanks
does anyone know how to
I am just starting my dive into Blender coming mainly from Quake's Radiant. I am trying to research whether it will fit the need I have for a level editor replacement. So with that in mind, here is my question:
What is the best method for creating and storing a set of prefab "entity" objects such as health packs, ammo pickups, and "moveable" objects such that they have a set of "properties" that can be changed within Blender?
I have found this page, but I am still getting lost as to how to integrate them on a per object basis and achieve the desired result:
https://docs.blender.org/manual/en/dev/editors/properties_editor.html
Note: It is not my goal to use the Blender game engine - just attach values to things for me to export to my own engine.
Edit1: Found an article discussing the topic although it seems very outdated:
https://www.gamasutra.com/blogs/IwanGabovitch/20120524/171032/Using_Blender_3D_as_a_3d_map_editor_rather_than_programming_your_own_from_scratch.php
Example:
// entity 105
{
"inv_item" "2"
"inv_name" "#str_02917"
"classname" "item_medkit"
"name" "item_medkit_11"
"origin" "-150 2322 72"
"triggerFirst" "1"
"triggersize" "40"
"rotation" "0.224951 0.97437 0 -0.97437 0.224951 0 0 0 1"
}
While we can manually add custom properties to any object, these are added to the specific object so can be unique to each object.
A better way of integrating new properties is to use bpy.props, these can be added to an objects class in blender, this means every object will have the same properties available.
You can setup a custom panel to edit your properties, like this simple example. Both the properties and panel as well as your object exporter can be defined in an addon which you can have enable at startup so that it is available every time you run blender. An addon also makes it easier for you to share your game editor with others.
The link I found seems to be the best option and allow for the most flexibility. The source code for the Super Tux Kart plugins serve as a great reference implementation:
https://sourceforge.net/p/supertuxkart/code/HEAD/tree/media/trunk/blender_26/
I rather newcomer in QML and can't find the best solution to work with QML TableView regarding C++ models. Almost all google's links say that I should use QAbstractTableModel. However, the problem in using this model (or better to say Presenter) is that I shoud emit dataUpdated every time anything is changed in real data.
But my approach is to create RowPresenter with QObject-derived properties for every column-cell (e.g. NameCellPresenter, StatisticsCellPresenter etc.) All these cell objects have complex data and it should be displayed in cell via properties. Moreover, I could display several types of data in one cell. And nobody, except these cell presenter objects, will never know about changing (RowPresenter or List of RowPresenter will only do their function of creating/removing...)
The questions are:
How could I efficiently update to QML the number of rows and rows from QList<RowPresenter> (without resetting ContextProperty) ?
Are there any methods to work with QAbstractTableModel in such way: only cell presenter knows about changing, and displaying complex data in one cell that could be changed independent from different threads?
I am learning Objective-C Cocoa programming for OS X, and object-based programming in general, so I am a big novice here, so my question is a bit general and my guess is the answer to this is simply "experience"; however, I am curious if there is some route of knowledge to understanding what methods in various classes are best or perhaps required for getting tasks done.
For example, in a programming guide I am instructed to create a document-based program, and the document class contains an array to store data, with the following method bound to a button to create a new entry in the array:
- (IBAction)insertItem:(id)sender {
if (!theItems) {
theItems = [NSMutableArray array];
}
[theItems addObject:#"Double-click to edit."];
[theTableView reloadData];
[self updateChangeCount:NSChangeDone];
}
The array is "theItems" and its data is being presented in a TableView object. I understand that the steps here add a new string to the array and then refresh the table to display it, followed by setting the document to be set to an unsaved state.
What I am not getting is how one would know these specific steps and methods are required. Intuitively it seems one would just add items to the array, and that would be all that's required to have the new values simply show up in the table view for which the array is the data source, so how would one know that the tableView would need to be refreshed with the "reloadData" call? I can see someone (myself) figuring it out by trial and error, but is there some quick resource or guide (ie, some quick flow-chart) either in XCode or elsewhere that indicates for a table view that this would have to be a required action to display the new entry?
If I look at Apple's NSTableView class reference, it claims in the overview that you "modify the values in the data source and allow the changes to be reflected in the table view" which suggest the view is updated automatically, so the requirement to call "reloadData" on the view seems a little obscure.
Look for the guides. In the online class reference for NSTableView, there's a section at the top called "Companion Guides". For NSTableView, it lists the Table View Programming Guide for Mac. (In the prerelease 10.10 docs, the guides are listed under Related Documentation in the left-hand sidebar.)
I could have sworn this same information was available in Xcode's Documentation window, albeit somewhat hidden behind a "More related items" pseudo-link, but when I check right now there's no link to the guide anywhere in the NSTableView class reference. Which is a terrible oversight.
You can also browse or search the Guides section of the developer library.
Familiarity, studying the documentation and possibly reading some good books is the answer. For example, in the docs you quoted (emphasis mine)
you should modify the values in the data source and allow the changes to be reflected in the table view
You should do both these things. If you want it to happen "automatically", look into bindings, which uses several other Cocoa features you won't understand at this point either to do the table data source stuff for you. I'd recommend understanding what is happening manually before handing over control to bindings, so you have some chance of understanding when things go wrong.
As well as looking at the table view documentation, you also need to study the cell, delegate and datasource references. All of those objects work together to give you the functioning table view.